mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-25 14:11:45 +01:00
refactor(test): make uom
This commit is contained in:
@@ -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 = [
|
||||
|
||||
Reference in New Issue
Block a user