Skip to content
Snippets Groups Projects
Commit 86a99af1 authored by Tom De Caluwé's avatar Tom De Caluwé
Browse files

[FIX] hr_holidays: make test_current_leave_status deterministic


The test_current_leave_status checks the correct implementation of different
hr.leave computed fields. To do this, a leave is created, during the test. The
test fails however, when the employee is not supposed to work during the leave
period, which can happen when running the test on certain days. The test is
made deterministic again by adding the number_of_days field to the dict. As
this is a stored field, the created leave entry will be considered valid.

closes odoo/odoo#122826

X-original-commit: a1dffd3f
Signed-off-by: default avatarKevin Baptiste <kba@odoo.com>
parent 8e65ecb3
No related branches found
No related tags found
No related merge requests found
......@@ -913,8 +913,9 @@ class TestLeaveRequests(TestHrHolidaysCommon):
'holiday_type': 'employee',
'employee_id': employee.id,
'holiday_status_id': leave_type.id,
'date_from': datetime.today() - timedelta(days=1),
'date_to': datetime.today() + timedelta(days=1),
'date_from': fields.Date.today(),
'date_to': fields.Date.today() + timedelta(days=2),
'number_of_days': 2,
})
if leave_validation_type in ('manager', 'both'):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment