summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJérome Maes <jem@openerp.com>2017-05-11 17:57:30 +0200
committerJérome Maes <jem@openerp.com>2017-05-11 18:27:33 +0200
commite7e8ecc77b56a2e15d5e158f0f0ff8aa2cc91285 (patch)
treec656753dfa5984a36fbb1d9cdd4563f601c55c0e
parent0d4ed7abf581b1aee7f67eb11b25780d33d57866 (diff)
[FIX] project_timesheet_holidays: fix tests
Handling datetime is not a good idea, mostly when computing different in terms of days. Forcing the hour (time) will set the tests correctly regarding the working hours, and the datetime difference, independently of the execution time of the test.
-rw-r--r--addons/project_timesheet_holidays/tests/test_timesheet_holidays.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/project_timesheet_holidays/tests/test_timesheet_holidays.py b/addons/project_timesheet_holidays/tests/test_timesheet_holidays.py
index 0131556ee9c..f49cf00ed14 100644
--- a/addons/project_timesheet_holidays/tests/test_timesheet_holidays.py
+++ b/addons/project_timesheet_holidays/tests/test_timesheet_holidays.py
@@ -17,7 +17,7 @@ class TestTimesheetHolidays(TestTimesheet):
self.employee_working_calendar = self.empl_employee.resource_calendar_id
# leave dates : from next monday to next wednesday (to avoid crashing tests on weekend, when
# there is no work days in working calendar)
- self.leave_start_datetime = datetime.today() + relativedelta(weeks=0, days=1, weekday=0)
+ self.leave_start_datetime = datetime.today().replace(hour=7, minute=0) + relativedelta(weeks=0, days=1, weekday=0)
self.leave_end_datetime = self.leave_start_datetime + relativedelta(days=3)
# all company have those internal project/task (created by default)