mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-14 23:18:40 +00:00
test(manufacturing): cover BOM item search when item code collides with a barcode
This commit is contained in:
@@ -530,6 +530,29 @@ class TestBOM(ERPNextTestSuite):
|
||||
self.assertNotEqual(len(test_items), len(filtered), msg="Item filtering showing excessive results")
|
||||
self.assertTrue(0 < len(filtered) <= 3, msg="Item filtering showing excessive results")
|
||||
|
||||
@timeout
|
||||
def test_bom_item_query_matches_item_code_colliding_with_another_barcode(self):
|
||||
item = make_item(
|
||||
"_Test BOM Query 2.5MM",
|
||||
{"is_stock_item": 1, "item_name": "_Test BOM Query Sheet", "description": "sheet"},
|
||||
)
|
||||
make_item(
|
||||
"_Test BOM Query Barcode Holder",
|
||||
{"is_stock_item": 1},
|
||||
barcode=f"90{item.name}90",
|
||||
)
|
||||
|
||||
results = item_query(
|
||||
doctype="Item",
|
||||
txt=item.name,
|
||||
searchfield="name",
|
||||
start=0,
|
||||
page_len=20,
|
||||
filters={"is_stock_item": 1},
|
||||
)
|
||||
|
||||
self.assertIn(item.name, [d[0] for d in results])
|
||||
|
||||
@timeout
|
||||
def test_exclude_exploded_items_from_bom(self):
|
||||
bom_no = get_default_bom()
|
||||
|
||||
Reference in New Issue
Block a user