test: Unique Employee IDs for tests
diff --git a/erpnext/projects/report/employee_hours_utilization_based_on_timesheet/employee_hours_utilization_based_on_timesheet.py b/erpnext/projects/report/employee_hours_utilization_based_on_timesheet/employee_hours_utilization_based_on_timesheet.py
index bc9dc7d..2c78b31 100644
--- a/erpnext/projects/report/employee_hours_utilization_based_on_timesheet/employee_hours_utilization_based_on_timesheet.py
+++ b/erpnext/projects/report/employee_hours_utilization_based_on_timesheet/employee_hours_utilization_based_on_timesheet.py
@@ -23,7 +23,7 @@
def validate_dates(self):
self.day_span = (self.to_date - self.from_date).days
- if self.day_span < 0:
+ if self.day_span <= 0:
frappe.throw(_('From Date must come before To Date'))
def run(self):
diff --git a/erpnext/projects/report/employee_hours_utilization_based_on_timesheet/test_employee_util.py b/erpnext/projects/report/employee_hours_utilization_based_on_timesheet/test_employee_util.py
index 5306b92..e01e9b1 100644
--- a/erpnext/projects/report/employee_hours_utilization_based_on_timesheet/test_employee_util.py
+++ b/erpnext/projects/report/employee_hours_utilization_based_on_timesheet/test_employee_util.py
@@ -12,8 +12,8 @@
@classmethod
def setUpClass(cls):
# Create test employee
- cls.test_emp1 = make_employee("test@example.com", "_Test Company")
- cls.test_emp2 = make_employee("test1@example.com", "_Test Company")
+ cls.test_emp1 = make_employee("test1@employeeutil.com", "_Test Company")
+ cls.test_emp2 = make_employee("test2@employeeutil.com", "_Test Company")
# Create test project
cls.test_project = make_project({"project_name": "_Test Project"})
@@ -80,7 +80,7 @@
expected_data = [
{
- 'employee': 'EMP-00002',
+ 'employee': self.test_emp2,
'billed_hours': 0.0,
'non_billed_hours': 10.0,
'total_hours': 18.0,
@@ -88,7 +88,7 @@
'per_util': 55.56
},
{
- 'employee': 'EMP-00001',
+ 'employee': self.test_emp1,
'billed_hours': 5.0,
'non_billed_hours': 0.0,
'total_hours': 18.0,
@@ -111,7 +111,7 @@
expected_data = [
{
- 'employee': 'EMP-00001',
+ 'employee': self.test_emp1,
'billed_hours': 5.0,
'non_billed_hours': 0.0,
'total_hours': 18.0,
@@ -134,7 +134,7 @@
expected_data = [
{
- 'employee': 'EMP-00002',
+ 'employee': self.test_emp2,
'billed_hours': 0.0,
'non_billed_hours': 10.0,
'total_hours': 18.0,