-
Notifications
You must be signed in to change notification settings - Fork 699
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: update test to check for shift of employees on leave
- Loading branch information
1 parent
642fe9e
commit d8f0aa8
Showing
1 changed file
with
5 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,9 @@ def test_monthly_attendance_sheet_report(self): | |
mark_attendance(self.employee, previous_month_first + relativedelta(days=1), "Present") | ||
mark_attendance(self.employee, previous_month_first + relativedelta(days=2), "On Leave") | ||
|
||
employee_on_leave_with_shift = make_employee("[email protected]", company=self.company) | ||
mark_attendance(employee_on_leave_with_shift, previous_month_first, "On Leave", "Day Shift") | ||
|
||
filters = frappe._dict( | ||
{ | ||
"month": previous_month_first.month, | ||
|
@@ -50,14 +53,14 @@ def test_monthly_attendance_sheet_report(self): | |
) | ||
report = execute(filters=filters) | ||
|
||
record = report[1][0] | ||
datasets = report[3]["data"]["datasets"] | ||
absent = datasets[0]["values"] | ||
present = datasets[1]["values"] | ||
leaves = datasets[2]["values"] | ||
|
||
# ensure correct attendance is reflected on the report | ||
self.assertEqual(self.employee, record.get("employee")) | ||
self.assertEqual(self.employee, report[1][0].get("employee")) | ||
self.assertEqual("Day Shift", report[1][1].get("shift")) | ||
self.assertEqual(absent[0], 1) | ||
self.assertEqual(present[1], 1) | ||
self.assertEqual(leaves[2], 1) | ||
|