def test_allow_annual_leave_overlap(self): self.bob.shifts.create( day=self.today, shift_type=self.late_shift, end=Shift.make_datetime(self.today.day, time(16, 15)) ) self.bob.shifts.create( day=self.today, shift_type=self.annual_leave, start=Shift.make_datetime(self.today.day, time(16, 0)) )
def test_multiple_annual_leave(self): self.bob.shifts.create( day=self.today, shift_type=self.annual_leave, end=Shift.make_datetime(self.today.day, time(12, 1)) ) with self.assert_validation_errors([MultipleAnnualLeaveError]): self.bob.shifts.create( day=self.today, shift_type=self.annual_leave, start=Shift.make_datetime(self.today.day, time(12, 0)) )
def test_reject_overlap(self): self.bob.shifts.create( day=self.today, shift_type=self.late_shift, end=Shift.make_datetime(self.today.day, time(16, 15)) ) with self.assert_validation_errors([ShiftsOverlapError]): self.bob.shifts.create( day=self.today, shift_type=self.late_shift, start=Shift.make_datetime(self.today.day, time(16, 0)) )