From e7e8ecc77b56a2e15d5e158f0f0ff8aa2cc91285 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Maes?= Date: Thu, 11 May 2017 17:57:30 +0200 Subject: [PATCH] [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. --- .../project_timesheet_holidays/tests/test_timesheet_holidays.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)