more test cases for Supplier

This commit is contained in:
tunde 2017-09-05 01:17:14 +01:00
parent ed86efb1fd
commit 743ba690dd

View File

@ -38,25 +38,20 @@ class TestSupplier(unittest.TestCase):
frappe.db.set_value("Supplier", "_Test Supplier With Template 1", "payment_terms", "") frappe.db.set_value("Supplier", "_Test Supplier With Template 1", "payment_terms", "")
# Set credit limit for the supplier type instead of supplier and evaluate the due date # Set credit limit for the supplier type instead of supplier and evaluate the due date
# frappe.db.set_value("Supplier Type", "_Test Supplier Type", "credit_days_based_on", frappe.db.set_value("Supplier Type", "_Test Supplier Type", "payment_terms", "_Test Payment Term Template 3")
# "Fixed Days")
# frappe.db.set_value("Supplier Type", "_Test Supplier Type", "credit_days", 10) due_date = get_due_date("2016-01-22", "Supplier", "_Test Supplier With Template 1")
# self.assertEqual(due_date, "2016-02-21")
# due_date = get_due_date("2016-01-22", "Supplier", "_Test Supplier", "_Test Company")
# self.assertEqual(due_date, "2016-02-01") # Set credit limit for the 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")
# # Set credit limit for the supplier type instead of supplier and evaluate the due date
# # based on Last day of next month # Leap year
# frappe.db.set_value("Supplier", "_Test Supplier Type", "credit_days", 0) due_date = get_due_date("2016-01-22", "Supplier", "_Test Supplier With Template 1")
# frappe.db.set_value("Supplier Type", "_Test Supplier Type", "credit_days_based_on", self.assertEqual(due_date, "2016-02-29")
# "Last Day of the Next Month")
#
# # Leap year
# due_date = get_due_date("2016-01-22", "Supplier", "_Test Supplier", "_Test Company")
# self.assertEqual(due_date, "2016-02-29")
# # Non Leap year # # Non Leap year
# due_date = get_due_date("2017-01-22", "Supplier", "_Test Supplier", "_Test Company") due_date = get_due_date("2017-01-22", "Supplier", "_Test Supplier With Template 1")
# self.assertEqual(due_date, "2017-02-28") self.assertEqual(due_date, "2017-02-28")
def test_supplier_disabled(self): def test_supplier_disabled(self):
make_test_records("Item") make_test_records("Item")