From 3ceae65669e5fe8d0b1641ad9b4621af3fb0c4e5 Mon Sep 17 00:00:00 2001 From: jem-odoo Date: Mon, 19 Mar 2018 15:06:25 +0000 Subject: [PATCH] [FIX] project_timesheet_holidays: fix tests due to DST To avoid harcorded dates in this test, we use next monday as starting date for leaves and timesheets. But today (19/03/2018), next monday will be after the daylight savings time, so resource module gives one additionnal day with one hour to be worked, so one more timesheet is generated and fails the test. To avoid this, we are now hardcoded dates to a monday (to avoid weekend and global leaves) and be sure the number of working days will be 3. --- .../tests/test_timesheet_holidays.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/project_timesheet_holidays/tests/test_timesheet_holidays.py b/addons/project_timesheet_holidays/tests/test_timesheet_holidays.py index 75c868c9d09..7f69b3d7c5c 100644 --- a/addons/project_timesheet_holidays/tests/test_timesheet_holidays.py +++ b/addons/project_timesheet_holidays/tests/test_timesheet_holidays.py @@ -33,8 +33,7 @@ class TestTimesheetHolidays(TestTimesheet): # leave dates : from next monday to next wednesday (to avoid crashing tests on weekend, when # there is no work days in working calendar) # NOTE: second and millisecond can add a working days - today = datetime.combine(datetime.today(), time.min) - self.leave_start_datetime = today.replace(hour=7) + relativedelta(weeks=0, days=1, weekday=0) + self.leave_start_datetime = datetime(2018, 2, 5, 7, 0, 0, 0) # this is monday self.leave_end_datetime = self.leave_start_datetime + relativedelta(days=3) # all company have those internal project/task (created by default)