From bcc6ea450a17dff1bebc69f562754fd966dc8ca7 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Mon, 5 Dec 2016 18:32:57 +0530 Subject: [PATCH 1/2] [fix] test cases for customer credit --- erpnext/selling/doctype/customer/test_customer.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/selling/doctype/customer/test_customer.py b/erpnext/selling/doctype/customer/test_customer.py index 36e4819ffe..23df503084 100644 --- a/erpnext/selling/doctype/customer/test_customer.py +++ b/erpnext/selling/doctype/customer/test_customer.py @@ -16,6 +16,9 @@ test_ignore = ["Price List"] test_records = frappe.get_test_records('Customer') class TestCustomer(unittest.TestCase): + def tearDown(self): + frappe.db.set_value("Customer", '_Test Customer', 'credit_limit', 0.0) + def test_party_details(self): from erpnext.accounts.party import get_party_details From 6f6a533d66e6c446560ac37cac2bc38a0a85ab06 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Mon, 5 Dec 2016 19:20:29 +0530 Subject: [PATCH 2/2] [fix] salary slip working days --- .../hr/doctype/salary_slip/test_salary_slip.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/erpnext/hr/doctype/salary_slip/test_salary_slip.py b/erpnext/hr/doctype/salary_slip/test_salary_slip.py index 8cf0688dd1..57a3711fc0 100644 --- a/erpnext/hr/doctype/salary_slip/test_salary_slip.py +++ b/erpnext/hr/doctype/salary_slip/test_salary_slip.py @@ -55,8 +55,8 @@ class TestSalarySlip(unittest.TestCase): ss = frappe.get_doc("Salary Slip", self.make_employee_salary_slip("test_employee@salary.com")) - self.assertEquals(ss.total_days_in_month, 27) - self.assertEquals(ss.payment_days, 27) + self.assertEquals(ss.total_days_in_month, 28) + self.assertEquals(ss.payment_days, 28) self.assertEquals(ss.earnings[0].amount, 5000) self.assertEquals(ss.earnings[0].default_amount, 5000) self.assertEquals(ss.earnings[1].amount, 3000) @@ -76,23 +76,23 @@ class TestSalarySlip(unittest.TestCase): ss = frappe.get_doc("Salary Slip", self.make_employee_salary_slip("test_employee@salary.com")) - self.assertEquals(ss.total_days_in_month, 27) - self.assertEquals(ss.payment_days, 27) + self.assertEquals(ss.total_days_in_month, 28) + self.assertEquals(ss.payment_days, 28) # set relieving date in the same month frappe.db.set_value("Employee", frappe.get_value("Employee", {"employee_name":"test_employee@salary.com"}, "name"), "relieving_date", "12-12-2016") frappe.db.set_value("Employee", frappe.get_value("Employee", {"employee_name":"test_employee@salary.com"}, "name"), "status", "Left") - self.assertEquals(ss.total_days_in_month, 27) - self.assertEquals(ss.payment_days, 27) + self.assertEquals(ss.total_days_in_month, 28) + self.assertEquals(ss.payment_days, 28) ss.save() frappe.db.set_value("Employee", frappe.get_value("Employee", {"employee_name":"test_employee@salary.com"}, "name"), "relieving_date", None) frappe.db.set_value("Employee", frappe.get_value("Employee", {"employee_name":"test_employee@salary.com"}, "name"), "status", "Active") # Holidays included in working days frappe.db.set_value("HR Settings", None, "include_holidays_in_total_working_days", 1) - self.assertEquals(ss.total_days_in_month, 27) - self.assertEquals(ss.payment_days, 27) + self.assertEquals(ss.total_days_in_month, 28) + self.assertEquals(ss.payment_days, 28) ss.save() # # frappe.db.set_value("Employee", frappe.get_value("Employee", {"employee_name":"test_employee@salary.com"}, "name"), "date_of_joining", "2001-01-11")