mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-15 15:38:39 +00:00
test: stop relying on companies having no default warehouse
Companies now get their Stores warehouse as Default Warehouse, so item warehouse resolution succeeds where it previously came back empty. test_internal_pr_reference cleared inter_company_reference and asserted a ValidationError, but no validation covers that field - the mapper already sets it. It was incidentally catching 'Row #1: Warehouse is mandatory for stock Item' from the blank target warehouse, so the assertion never tested what it claimed. Dropped it; the delivery_note_item assertion below still covers the reference linkage. test_inter_company_transaction_without_default_warehouse now establishes its own premise by clearing the company's default warehouse instead of relying on it being unset. Its failure previously skipped the teardown that restores frappe.local.enable_perpetual_inventory, which db rollback cannot undo, which in turn broke two later inter-company tests.
This commit is contained in:
@@ -3215,6 +3215,10 @@ class TestSalesInvoice(ERPNextTestSuite):
|
||||
"Stock Received But Not Billed - _TC1",
|
||||
)
|
||||
|
||||
# companies are created with their Stores warehouse as Default Warehouse; clear it so the
|
||||
# item genuinely maps without one
|
||||
frappe.db.set_value("Company", "_Test Company 1", "default_warehouse", None)
|
||||
|
||||
# begin test
|
||||
si = create_sales_invoice(
|
||||
company="Wind Power LLC",
|
||||
|
||||
@@ -2395,9 +2395,6 @@ class TestPurchaseReceipt(ERPNextTestSuite):
|
||||
from erpnext.stock.doctype.delivery_note.mapper import make_inter_company_purchase_receipt
|
||||
|
||||
pr = make_inter_company_purchase_receipt(dn.name)
|
||||
pr.inter_company_reference = ""
|
||||
self.assertRaises(frappe.ValidationError, pr.save)
|
||||
|
||||
pr.inter_company_reference = dn.name
|
||||
pr.items[0].qty = 10
|
||||
pr.items[0].from_warehouse = target_warehouse
|
||||
|
||||
Reference in New Issue
Block a user