From 15d65e4626318f68401bb4f7244772116cf00d0e Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 1 Jul 2026 16:10:22 +0530 Subject: [PATCH] test: keep created BOMs non-default so fixtures are not replaced --- .../stock/report/bom_search/test_bom_search.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/erpnext/stock/report/bom_search/test_bom_search.py b/erpnext/stock/report/bom_search/test_bom_search.py index 344663f594f..0789f271237 100644 --- a/erpnext/stock/report/bom_search/test_bom_search.py +++ b/erpnext/stock/report/bom_search/test_bom_search.py @@ -17,7 +17,10 @@ class TestBomSearch(ERPNextTestSuite): raw_material = "_Test Item" finished_good = "_Test FG Item" - bom = frappe.get_doc(doctype="BOM", item=finished_good, company="_Test Company", currency="INR") + # is_default=0 so the test doesn't replace the fixture default BOM for the item + bom = frappe.get_doc( + doctype="BOM", item=finished_good, company="_Test Company", currency="INR", is_default=0 + ) bom.append("items", {"item_code": raw_material, "qty": 1}) bom.insert() bom.submit() @@ -32,9 +35,15 @@ class TestBomSearch(ERPNextTestSuite): finished_good = "_Test FG Item 2" # top-level BOM uses the sub-assembly (it does NOT list the raw material directly). - # the bootstrap sub-assembly BOM is in USD, so match its currency. + # the bootstrap sub-assembly BOM is in USD, so match its currency; is_default=0 so the + # test doesn't replace the fixture default BOM for the finished good. top_bom = frappe.get_doc( - doctype="BOM", item=finished_good, company="_Test Company", currency="USD", conversion_rate=1 + doctype="BOM", + item=finished_good, + company="_Test Company", + currency="USD", + conversion_rate=1, + is_default=0, ) top_bom.append("items", {"item_code": sub_assembly, "qty": 1}) top_bom.insert()