From 2d3a575f296a1103749ac112bad104e11199496f Mon Sep 17 00:00:00 2001 From: tunde Date: Thu, 7 Sep 2017 14:50:20 +0100 Subject: [PATCH] more test cases for purchase/sales invoice --- .../doctype/purchase_invoice/test_purchase_invoice.py | 6 ++++++ .../accounts/doctype/sales_invoice/test_sales_invoice.py | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py index 60f9b3fd13..59e64aa4d0 100644 --- a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py @@ -62,6 +62,12 @@ class TestPurchaseInvoice(unittest.TestCase): set_perpetual_inventory(0, pi.company) + def test_terms_added_after_save(self): + pi = frappe.copy_doc(test_records[1]) + pi.insert() + self.assertTrue(pi.payment_schedule) + self.assertEqual(pi.payment_schedule[0].due_date, pi.due_date) + def test_payment_entry_unlink_against_purchase_invoice(self): from erpnext.accounts.doctype.payment_entry.test_payment_entry import get_payment_entry unlink_payment_on_cancel_of_invoice(0) diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py index 56181fc8c6..44cc8d774e 100644 --- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py @@ -58,6 +58,13 @@ class TestSalesInvoice(unittest.TestCase): self.assertRaises(frappe.CannotChangeConstantError, si.save) + def test_add_terms_after_save(self): + si = frappe.copy_doc(test_records[2]) + si.insert() + + self.assertTrue(si.payment_schedule) + self.assertEqual(si.payment_schedule[0].due_date, si.due_date) + def test_sales_invoice_calculation_base_currency(self): si = frappe.copy_doc(test_records[2]) si.insert()