From 5d217295e546e82ea213dd68a7fbd54884c3e745 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 26 Jun 2026 13:28:09 +0530 Subject: [PATCH] test: reuse BootStrapTestData master data to reduce runtime Co-Authored-By: Claude Opus 4.8 (1M context) --- .../test_stock_ledger_variance.py | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/erpnext/stock/report/stock_ledger_variance/test_stock_ledger_variance.py b/erpnext/stock/report/stock_ledger_variance/test_stock_ledger_variance.py index e561a2fce5a..2459204ca8f 100644 --- a/erpnext/stock/report/stock_ledger_variance/test_stock_ledger_variance.py +++ b/erpnext/stock/report/stock_ledger_variance/test_stock_ledger_variance.py @@ -16,21 +16,21 @@ class TestStockLedgerVariance(ERPNextTestSuite): return execute(frappe._dict(filters))[1] def test_healthy_stock_has_no_variance(self): - from erpnext.stock.doctype.item.test_item import make_item from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry - item = make_item(properties={"is_stock_item": 1, "valuation_method": "Moving Average"}).name + item = "_Test Item" + frappe.db.set_value("Item", item, "valuation_method", "Moving Average") make_stock_entry( item_code=item, - to_warehouse="_Test Warehouse - _TC", + to_warehouse="Stores - _TC", qty=10, rate=100, posting_date="2026-06-01", ) make_stock_entry( item_code=item, - from_warehouse="_Test Warehouse - _TC", + from_warehouse="Stores - _TC", qty=4, posting_date="2026-06-02", ) @@ -44,35 +44,35 @@ class TestStockLedgerVariance(ERPNextTestSuite): self.assertFalse([row for row in qty_data if row.get("item_code") == item]) def test_multiple_clean_movements_no_variance(self): - from erpnext.stock.doctype.item.test_item import make_item from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry - item = make_item(properties={"is_stock_item": 1, "valuation_method": "Moving Average"}).name + item = "_Test Item" + frappe.db.set_value("Item", item, "valuation_method", "Moving Average") make_stock_entry( item_code=item, - to_warehouse="_Test Warehouse - _TC", + to_warehouse="Stores - _TC", qty=10, rate=100, posting_date="2026-06-01", ) make_stock_entry( item_code=item, - to_warehouse="_Test Warehouse - _TC", + to_warehouse="Stores - _TC", qty=5, rate=120, posting_date="2026-06-02", ) make_stock_entry( item_code=item, - to_warehouse="_Test Warehouse - _TC", + to_warehouse="Stores - _TC", qty=8, rate=90, posting_date="2026-06-03", ) make_stock_entry( item_code=item, - from_warehouse="_Test Warehouse - _TC", + from_warehouse="Stores - _TC", qty=6, posting_date="2026-06-04", )