[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.
This commit is contained in:
jem-odoo
2018-03-19 16:34:13 +00:00
parent 1b5d0c3773
commit 3ceae65669
@@ -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)