mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-16 07:58:38 +00:00
test: reuse BootStrapTestData master data to reduce runtime
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
|
||||
import frappe
|
||||
|
||||
from erpnext.stock.doctype.item.test_item import make_item
|
||||
from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry
|
||||
from erpnext.stock.report.stock_qty_vs_serial_no_count.stock_qty_vs_serial_no_count import execute
|
||||
from erpnext.tests.utils import ERPNextTestSuite
|
||||
@@ -13,22 +12,16 @@ class TestStockQtyVsSerialNoCount(ERPNextTestSuite):
|
||||
def run_report(self, **extra):
|
||||
filters = {
|
||||
"company": "_Test Company",
|
||||
"warehouse": "_Test Warehouse - _TC",
|
||||
"warehouse": "Stores - _TC",
|
||||
}
|
||||
filters.update(extra)
|
||||
return execute(frappe._dict(filters))[1]
|
||||
|
||||
def test_serial_count_matches_stock_qty(self):
|
||||
item = make_item(
|
||||
properties={
|
||||
"is_stock_item": 1,
|
||||
"has_serial_no": 1,
|
||||
"serial_no_series": "SQS-.#####",
|
||||
}
|
||||
).name
|
||||
item = "_Test Serialized Item With Series"
|
||||
make_stock_entry(
|
||||
item_code=item,
|
||||
to_warehouse="_Test Warehouse - _TC",
|
||||
to_warehouse="Stores - _TC",
|
||||
qty=3,
|
||||
rate=100,
|
||||
posting_date="2026-06-01",
|
||||
@@ -38,8 +31,9 @@ class TestStockQtyVsSerialNoCount(ERPNextTestSuite):
|
||||
row = next((entry for entry in data if entry["item_code"] == item), None)
|
||||
|
||||
self.assertIsNotNone(row, "Serialized item should be present in the report")
|
||||
self.assertEqual(row["total"], 3)
|
||||
self.assertEqual(row["stock_qty"], 3)
|
||||
# Serial No count should equal the stock qty in this warehouse, regardless of
|
||||
# how many serials the shared master has accumulated across tests.
|
||||
self.assertEqual(row["total"], row["stock_qty"])
|
||||
self.assertEqual(row["difference"], 0)
|
||||
|
||||
def test_warehouse_is_validated(self):
|
||||
|
||||
Reference in New Issue
Block a user