From c17517d22a17f409420a597e0a51dbf25e1a5ff1 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 2 Jul 2026 13:55:16 +0530 Subject: [PATCH] test: use a unique item group per run in COGS test --- .../report/cogs_by_item_group/test_cogs_by_item_group.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/stock/report/cogs_by_item_group/test_cogs_by_item_group.py b/erpnext/stock/report/cogs_by_item_group/test_cogs_by_item_group.py index a7c4b384fbe..8e2004c7d46 100644 --- a/erpnext/stock/report/cogs_by_item_group/test_cogs_by_item_group.py +++ b/erpnext/stock/report/cogs_by_item_group/test_cogs_by_item_group.py @@ -27,7 +27,9 @@ class TestCogsByItemGroup(ERPNextTestSuite): # test's COGS. The report sums COGS up the whole item-group tree keyed on the # company's default expense account, so a shared group would accumulate COGS # booked by any other test/fixture for the same company within the date range. - item_group = make_item_group("_Test COGS Item Group") + # The group name is unique per run so items created by earlier runs (which + # reuse a fixed group name) can't inflate the total either. + item_group = make_item_group(f"_Test COGS Item Group {frappe.generate_hash(length=6)}") item = make_item(properties={"is_stock_item": 1, "item_group": item_group}).name make_stock_entry(