From 794001df504d83cd0c43dfdc98833cea5833f621 Mon Sep 17 00:00:00 2001 From: tunde Date: Wed, 6 Sep 2017 09:16:11 +0100 Subject: [PATCH] more test cases in Supplier --- erpnext/buying/doctype/supplier/test_supplier.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/erpnext/buying/doctype/supplier/test_supplier.py b/erpnext/buying/doctype/supplier/test_supplier.py index e54cc3adc9..16dda5c5ff 100644 --- a/erpnext/buying/doctype/supplier/test_supplier.py +++ b/erpnext/buying/doctype/supplier/test_supplier.py @@ -42,7 +42,7 @@ class TestSupplier(unittest.TestCase): due_date = get_due_date("2016-01-22", "Supplier", "_Test Supplier With Template 1") self.assertEqual(due_date, "2016-02-21") - # Set credit limit for the supplier type instead of supplier and evaluate the due date + # Payment terms for Supplier Type instead of supplier and evaluate the due date frappe.db.set_value("Supplier Type", "_Test Supplier Type", "payment_terms", "_Test Payment Term Template 1") # Leap year @@ -52,6 +52,16 @@ class TestSupplier(unittest.TestCase): due_date = get_due_date("2017-01-22", "Supplier", "_Test Supplier With Template 1") self.assertEqual(due_date, "2017-02-28") + # Supplier with no default Payment Terms Template + frappe.db.set_value("Supplier Type", "_Test Supplier Type", "payment_terms", "") + frappe.db.set_value("Supplier", "_Test Supplier", "payment_terms", "") + + due_date = get_due_date("2016-01-22", "Supplier", "_Test Supplier") + self.assertEqual(due_date, "2016-01-22") + # # Non Leap year + due_date = get_due_date("2017-01-22", "Supplier", "_Test Supplier") + self.assertEqual(due_date, "2017-01-22") + def test_supplier_disabled(self): make_test_records("Item")