fix(test_purchase_order): validation to create pi from po with terms

Fixed the test to check for error while creating Purchase Invoice from unsubmitted Purchase Order
This commit is contained in:
diptanilsaha
2026-02-19 14:43:24 +05:30
parent 531112e364
commit fa5eae08a0

View File

@@ -543,13 +543,12 @@ class TestPurchaseOrder(IntegrationTestCase):
@IntegrationTestCase.change_settings("Accounts Settings", {"automatically_fetch_payment_terms": 1})
def test_make_purchase_invoice_with_terms(self):
po = create_purchase_order(do_not_save=True)
with self.assertRaises(frappe.ValidationError):
make_pi_from_po(po.name)
po.update({"payment_terms_template": "_Test Payment Term Template"})
po.save()
self.assertRaises(frappe.ValidationError, make_pi_from_po, po.name)
po.submit()
self.assertEqual(po.payment_schedule[0].payment_amount, 2500.0)