[IMP] project_timesheet_holidays: improve test for employee timeoff

task-2727561

Part-of: odoo/odoo#86914
This commit is contained in:
Prakash Prajapati
2022-04-25 19:11:26 +02:00
parent 8e52c36a56
commit b364b5aa00
@@ -104,6 +104,11 @@ class TestTimesheetHolidays(TestCommonTimesheet):
'number_of_days': number_of_days,
})
holiday.with_user(SUPERUSER_ID).action_validate()
# The leave type and timesheet are linked to the same project and task'
self.assertEqual(holiday.timesheet_ids.project_id.id, self.internal_project.id)
self.assertEqual(holiday.timesheet_ids.task_id.id, self.internal_task_leaves.id)
self.assertEqual(len(holiday.timesheet_ids), number_of_days, 'Number of generated timesheets should be the same as the leave duration (1 per day between %s and %s)' % (fields.Datetime.to_string(self.leave_start_datetime), fields.Datetime.to_string(self.leave_end_datetime)))
# manager refuse the leave