mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-10 13:57:19 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user