refactor(test): make uom

This commit is contained in:
ruthra kumar
2025-06-20 12:33:35 +05:30
parent 402c7df643
commit 0feedd183b

View File

@@ -189,6 +189,7 @@ class ERPNextTestSuite(unittest.TestCase):
cls.make_user()
cls.make_cost_center()
cls.make_warehouse()
cls.make_uom()
cls.make_item_group()
cls.make_item()
cls.make_location()
@@ -1241,6 +1242,24 @@ class ERPNextTestSuite(unittest.TestCase):
)
)
@classmethod
def make_uom(cls):
records = [
{"doctype": "UOM", "must_be_whole_number": 1, "uom_name": "_Test UOM"},
{"doctype": "UOM", "uom_name": "_Test UOM 1"},
]
cls.uom = []
for x in records:
if not frappe.db.exists("UOM", {"uom_name": x.get("uom_name")}):
cls.uom.append(frappe.get_doc(x).insert())
else:
cls.uom.append(
frappe.get_doc(
"UOM",
{"uom_name": x.get("uom_name")},
)
)
@classmethod
def make_item_group(cls):
records = [