From 96dbbba06459350be3c96a767d950a236f2ba58d Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Thu, 30 Jun 2016 13:24:04 +0200 Subject: [PATCH] [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... --- addons/hr_holidays/tests/test_holidays_flow.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/hr_holidays/tests/test_holidays_flow.py b/addons/hr_holidays/tests/test_holidays_flow.py index 0b1b754d9c0..b89631d3db6 100644 --- a/addons/hr_holidays/tests/test_holidays_flow.py +++ b/addons/hr_holidays/tests/test_holidays_flow.py @@ -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 })