mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-14 18:51:21 +00:00
refactor(test): make sales order deterministic
This commit is contained in:
@@ -233,6 +233,7 @@ class ERPNextTestSuite(unittest.TestCase):
|
||||
cls.make_asset_maintenance_team()
|
||||
cls.make_asset_category()
|
||||
cls._make_item()
|
||||
cls.make_product_bundle()
|
||||
cls.make_location()
|
||||
cls.make_price_list()
|
||||
cls.make_item_price()
|
||||
@@ -2170,6 +2171,40 @@ class ERPNextTestSuite(unittest.TestCase):
|
||||
)
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def make_product_bundle(cls):
|
||||
records = [
|
||||
{
|
||||
"doctype": "Product Bundle",
|
||||
"new_item_code": "_Test Product Bundle Item",
|
||||
"items": [
|
||||
{
|
||||
"doctype": "Product Bundle Item",
|
||||
"item_code": "_Test Item",
|
||||
"parentfield": "items",
|
||||
"qty": 5.0,
|
||||
},
|
||||
{
|
||||
"doctype": "Product Bundle Item",
|
||||
"item_code": "_Test Item Home Desktop 100",
|
||||
"parentfield": "items",
|
||||
"qty": 2.0,
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
cls.product_bundle = []
|
||||
for x in records:
|
||||
if not frappe.db.exists("Product Bundle", {"new_item_code": x.get("new_item_code")}):
|
||||
cls.product_bundle.append(frappe.get_doc(x).insert())
|
||||
else:
|
||||
cls.product_bundle.append(
|
||||
frappe.get_doc(
|
||||
"Product Bundle",
|
||||
{"new_item_code": x.get("new_item_code")},
|
||||
)
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def make_test_account(cls):
|
||||
records = [
|
||||
|
||||
Reference in New Issue
Block a user