test: Add test case for summary data
diff --git a/erpnext/projects/report/employee_hours_utilisation_based_on_timesheet/test_employee_util.py b/erpnext/projects/report/employee_hours_utilisation_based_on_timesheet/test_employee_util.py
index 7b310fa..adf55af 100644
--- a/erpnext/projects/report/employee_hours_utilisation_based_on_timesheet/test_employee_util.py
+++ b/erpnext/projects/report/employee_hours_utilisation_based_on_timesheet/test_employee_util.py
@@ -68,7 +68,6 @@
frappe.db.sql("DELETE FROM `tabTimesheet` WHERE company='_Test Company'")
frappe.db.sql(f"DELETE FROM `tabProject` WHERE name='{cls.test_project.name}'")
- print(f"DELETE FROM `tabProject` WHERE name='{cls.test_project.name}'")
def test_utilisation_report_with_required_filters_only(self):
filters = {
@@ -144,4 +143,22 @@
}
]
- self.assertEqual(report[1], expected_data)
\ No newline at end of file
+ self.assertEqual(report[1], expected_data)
+
+ def test_report_summary_data(self):
+ filters = {
+ "company": "_Test Company",
+ "from_date": "2021-04-01",
+ "to_date": "2021-04-03"
+ }
+
+ report = execute(filters)
+ summary = report[4]
+ expected_summary_values = ['41.67%', 5.0, 10.0, 21.0]
+
+ self.assertEqual(len(summary), 4)
+
+ for i in range(4):
+ self.assertEqual(
+ summary[i]['value'], expected_summary_values[i]
+ )