test(manufacturing): make MPS lead-time fixture idempotent

Delete any existing Item Lead Time for the test item before inserting, so the test is re-runnable on a shared database (addresses review feedback).
This commit is contained in:
Mihir Kandoi
2026-06-23 13:20:58 +05:30
parent 28b5efcbe1
commit d225532595

View File

@@ -16,6 +16,8 @@ class TestMasterProductionSchedule(ERPNextTestSuite):
manufacturing_time_in_mins is an Int column; integer/integer division truncates on
PostgreSQL (720/1440 -> 0) while MariaDB yields 0.5, changing the planned release date."""
item = make_item("_Test MPS Lead Time Item", {"is_stock_item": 1}).name
# idempotent across re-runs / a shared CI database
frappe.db.delete("Item Lead Time", {"item_code": item})
frappe.get_doc(
{
"doctype": "Item Lead Time",