[FIX] hr_holidays: force employee during test

Since base.user_root has 2 employees (one in demo, one in data).
The method _compute_leaves will use the employee id forced in context.

The test should be improved later.
Maybe not 2 employees for same partner...
This commit is contained in:
Jeremy Kersten
2016-06-30 13:45:11 +02:00
parent aed9b23688
commit 96dbbba064
@@ -184,15 +184,16 @@ class TestHolidaysFlow(TestHrHolidaysBase):
with self.assertRaises(ValidationError):
hol2_manager_group.signal_workflow('confirm')
employee_id = self.ref('hr.employee_fp')
# cl can be of maximum 20 days for employee_fp
hol3_status = self.env.ref('hr_holidays.holiday_status_cl')
hol3_status = self.env.ref('hr_holidays.holiday_status_cl').with_context(employee_id=employee_id)
# I assign the dates in the holiday request for 1 day
hol3 = Holidays.create({
'name': 'Sick Leave',
'holiday_status_id': hol3_status.id,
'date_from': datetime.today().strftime('%Y-%m-10 10:00:00'),
'date_to': datetime.today().strftime('%Y-%m-11 19:00:00'),
'employee_id': self.ref('hr.employee_fp'),
'employee_id': employee_id,
'type': 'remove',
'number_of_days_temp': 1
})