fix: flaky tests

This commit is contained in:
Rucha Mahabal 2022-03-13 20:30:18 +05:30
parent 558650bc3a
commit d61c437588
2 changed files with 3 additions and 3 deletions

View File

@ -274,7 +274,7 @@ class TestLeaveApplication(unittest.TestCase):
employee = get_employee()
first_sunday = get_first_sunday(self.holiday_list)
leave_application = make_leave_application(employee.name, add_days(first_sunday, 1), add_days(first_sunday, 4), leave_type.name)
leave_application = make_leave_application(employee.name, first_sunday, add_days(first_sunday, 3), leave_type.name)
leave_application.reload()
self.assertEqual(leave_application.total_leave_days, 4)
self.assertEqual(frappe.db.count('Attendance', {'leave_application': leave_application.name}), 4)

View File

@ -65,7 +65,7 @@ class TestEmployeeLeaveBalance(unittest.TestCase):
leave_application2.reload()
filters = frappe._dict({
'date': self.date,
'date': add_days(leave_application2.to_date, 1),
'company': '_Test Company',
'employee': self.employee_id
})
@ -100,7 +100,7 @@ class TestEmployeeLeaveBalance(unittest.TestCase):
# Leave balance should show actual balance, and not "consumption balance as per remaining days", near alloc end date
# eg: 3 days left for alloc to end, leave balance should still be 26 and not 3
frappe._dict({
filters = frappe._dict({
'date': add_days(self.year_end, -3),
'company': '_Test Company',
'employee': self.employee_id