mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-16 18:24:10 +00:00
refactor(test): hardcoded names over dynamic ones
Much faster bootstrap without those get_doc calls
This commit is contained in:
@@ -392,7 +392,7 @@ class TestBOM(ERPNextTestSuite):
|
||||
item_code = make_item(properties={"is_stock_item": 1}).name
|
||||
|
||||
bom = frappe.new_doc("BOM")
|
||||
bom.company = self.companies[0].name
|
||||
bom.company = "_Test Company"
|
||||
bom.item = item_code
|
||||
bom.append("items", frappe._dict(item_code=item_code))
|
||||
bom.save()
|
||||
@@ -406,13 +406,13 @@ class TestBOM(ERPNextTestSuite):
|
||||
item2 = make_item(properties={"is_stock_item": 1}).name
|
||||
|
||||
bom1 = frappe.new_doc("BOM")
|
||||
bom1.company = self.companies[0].name
|
||||
bom1.company = "_Test Company"
|
||||
bom1.item = item1
|
||||
bom1.append("items", frappe._dict(item_code=item2))
|
||||
bom1.save()
|
||||
|
||||
bom2 = frappe.new_doc("BOM")
|
||||
bom2.company = self.companies[0].name
|
||||
bom2.company = "_Test Company"
|
||||
bom2.item = item2
|
||||
bom2.append("items", frappe._dict(item_code=item1))
|
||||
bom2.save()
|
||||
@@ -570,7 +570,7 @@ class TestBOM(ERPNextTestSuite):
|
||||
@timeout
|
||||
def test_clear_inpection_quality(self):
|
||||
bom = frappe.copy_doc(self.globalTestRecords["BOM"][2], ignore_no_copy=True)
|
||||
bom.company = self.companies[0].name
|
||||
bom.company = "_Test Company"
|
||||
bom.docstatus = 0
|
||||
bom.is_default = 0
|
||||
bom.quality_inspection_template = "_Test Quality Inspection Template"
|
||||
@@ -616,7 +616,7 @@ class TestBOM(ERPNextTestSuite):
|
||||
|
||||
# Step 1: Create BOM
|
||||
bom = frappe.new_doc("BOM")
|
||||
bom.company = self.companies[0].name
|
||||
bom.company = "_Test Company"
|
||||
bom.item = fg_item.item_code
|
||||
bom.quantity = 1
|
||||
bom.append(
|
||||
|
||||
@@ -87,7 +87,7 @@ class TestJobCard(ERPNextTestSuite):
|
||||
quantity=1,
|
||||
with_operations=1,
|
||||
track_semi_finished_goods=1,
|
||||
company=self.companies[9].name,
|
||||
company="_Test Company",
|
||||
)
|
||||
final_bom.append("items", {"item_code": raw.name, "qty": 1})
|
||||
final_bom.append(
|
||||
@@ -122,7 +122,7 @@ class TestJobCard(ERPNextTestSuite):
|
||||
final_bom.insert()
|
||||
final_bom.submit()
|
||||
work_order = make_work_order(final_bom.name, final.name, 1, variant_items=[], use_multi_level_bom=0)
|
||||
work_order.company = self.companies[9].name
|
||||
work_order.company = "_Test Company"
|
||||
work_order.wip_warehouse = "Work In Progress - WP"
|
||||
work_order.fg_warehouse = "Finished Goods - WP"
|
||||
work_order.scrap_warehouse = "All Warehouses - WP"
|
||||
|
||||
@@ -960,7 +960,7 @@ class TestWorkOrder(ERPNextTestSuite):
|
||||
bom_item,
|
||||
fg_qty=1,
|
||||
process_loss_percentage=10,
|
||||
company=self.companies[0].name,
|
||||
company="_Test Company",
|
||||
)
|
||||
bom_doc.submit()
|
||||
|
||||
@@ -1147,7 +1147,7 @@ class TestWorkOrder(ERPNextTestSuite):
|
||||
"is_active": 1,
|
||||
"is_default": 1,
|
||||
"quantity": 1.0,
|
||||
"company": self.companies[0].name,
|
||||
"company": "_Test Company",
|
||||
"with_operations": 1,
|
||||
"operations": [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user