mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-02 16:13:22 +00:00
test: make add_manually test distinguish manual mode from auto-loading
This commit is contained in:
@@ -41,13 +41,15 @@ class TestRepostPaymentLedger(ERPNextTestSuite):
|
|||||||
self.assertEqual(doc.repost_status, "Queued")
|
self.assertEqual(doc.repost_status, "Queued")
|
||||||
|
|
||||||
def test_add_manually_preserves_user_rows(self):
|
def test_add_manually_preserves_user_rows(self):
|
||||||
# a Sales Invoice that WOULD match the filter, to prove manual mode ignores it
|
# manually add a BEFORE-cutoff invoice (which the filter would never load) while a
|
||||||
si = create_sales_invoice(company=COMPANY, posting_date="2026-06-15", rate=100, qty=1)
|
# matching after-cutoff invoice also exists. If auto-loading wrongly ran it would
|
||||||
|
# drop the manual row and pull the after-cutoff one, so this distinguishes the modes.
|
||||||
|
manual_si = create_sales_invoice(company=COMPANY, posting_date="2026-01-15", rate=100, qty=1)
|
||||||
|
create_sales_invoice(company=COMPANY, posting_date="2026-06-15", rate=100, qty=1)
|
||||||
|
|
||||||
doc = self.make_repost(add_manually=1)
|
doc = self.make_repost(add_manually=1, posting_date="2026-06-01")
|
||||||
doc.append("repost_vouchers", {"voucher_type": "Sales Invoice", "voucher_no": si.name})
|
doc.append("repost_vouchers", {"voucher_type": "Sales Invoice", "voucher_no": manual_si.name})
|
||||||
doc.save()
|
doc.save()
|
||||||
|
|
||||||
rows = [(v.voucher_type, v.voucher_no) for v in doc.repost_vouchers]
|
rows = [(v.voucher_type, v.voucher_no) for v in doc.repost_vouchers]
|
||||||
# the row is kept exactly as entered; no filter-based auto-loading happens
|
self.assertEqual(rows, [("Sales Invoice", manual_si.name)])
|
||||||
self.assertEqual(rows, [("Sales Invoice", si.name)])
|
|
||||||
|
|||||||
Reference in New Issue
Block a user