From e01e3c0a62f204a13d0ec544f64de6f90a25ff74 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Thu, 12 Feb 2026 15:27:33 +0530 Subject: [PATCH] refactor(test): make job card deterministic --- .../manufacturing/doctype/job_card/test_job_card.py | 10 +++++++++- erpnext/tests/utils.py | 2 -- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/erpnext/manufacturing/doctype/job_card/test_job_card.py b/erpnext/manufacturing/doctype/job_card/test_job_card.py index 17975618f04..c23723ef012 100644 --- a/erpnext/manufacturing/doctype/job_card/test_job_card.py +++ b/erpnext/manufacturing/doctype/job_card/test_job_card.py @@ -86,7 +86,12 @@ class TestJobCard(ERPNextTestSuite): cut_bom = create_semi_fg_bom(cut_fg.name, raw.name, inspection_required=1) stitch_bom = create_semi_fg_bom(stitch_fg.name, cut_fg.name, inspection_required=0) final_bom = frappe.new_doc( - "BOM", item=final.name, quantity=1, with_operations=1, track_semi_finished_goods=1 + "BOM", + item=final.name, + quantity=1, + with_operations=1, + track_semi_finished_goods=1, + company=self.companies[9].name, ) final_bom.append("items", {"item_code": raw.name, "qty": 1}) final_bom.append( @@ -121,6 +126,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.wip_warehouse = "Work In Progress - WP" work_order.fg_warehouse = "Finished Goods - WP" work_order.scrap_warehouse = "All Warehouses - WP" @@ -886,6 +892,7 @@ class TestJobCard(ERPNextTestSuite): def create_bom(raw_material, finished_good, scrap_item, submit=True): bom = frappe.new_doc("BOM") + bom.company = "_Test Company" bom.item = finished_good bom.quantity = 1 bom.append("items", {"item_code": raw_material, "qty": 1}) @@ -1118,6 +1125,7 @@ def make_wo_with_transfer_against_jc(): def create_semi_fg_bom(semi_fg_item, raw_item, inspection_required): bom = frappe.new_doc("BOM") + bom.company = "Wind Power LLC" bom.item = semi_fg_item bom.quantity = 1 bom.inspection_required = inspection_required diff --git a/erpnext/tests/utils.py b/erpnext/tests/utils.py index 83009b277f8..2a1685de0e6 100644 --- a/erpnext/tests/utils.py +++ b/erpnext/tests/utils.py @@ -935,8 +935,6 @@ class ERPNextTestSuite(unittest.TestCase): "abbr": "WP", "industry": "Manufacturing", "country": "United States", - # "fy_start_date": f"{current_year}-01-01", - # "fy_end_date": f"{current_year}-12-31", "language": "english", "company_tagline": "Testing", "email": "test@erpnext.com",