diff options
| author | jem-odoo <jem@openerp.com> | 2018-03-19 15:06:25 +0000 |
|---|---|---|
| committer | jem-odoo <jem@openerp.com> | 2018-03-19 16:34:13 +0000 |
| commit | 3ceae65669e5fe8d0b1641ad9b4621af3fb0c4e5 (patch) | |
| tree | 2d093ee812d2e6526080fc2de9ed5b99c6996316 | |
| parent | 1b5d0c3773e4e296a458d3d44a136f3fd887b480 (diff) | |
[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.
| -rw-r--r-- | addons/project_timesheet_holidays/tests/test_timesheet_holidays.py | 3 |
1 files changed, 1 insertions, 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) |
