예제 #1
0
 def test_validate_dates_first_holiday(self):
     first_holiday = ACPHoliday.objects.all().first()
     last_holiday = ACPHoliday.objects.all().last()
     try:
         ACPHoliday.validate_dates(first_holiday.date - datetime.timedelta(days=1), last_holiday.date)
         self.fail('Value error should have been raised')
     except ValueError as e:
         self.assertEqual('Start date precedes the first registered holiday', str(e))
예제 #2
0
 def test_validate_dates_first_holiday(self):
     first_holiday = ACPHoliday.objects.all().first()
     last_holiday = ACPHoliday.objects.all().last()
     try:
         ACPHoliday.validate_dates(first_holiday.date - datetime.timedelta(days=1), last_holiday.date)
         self.fail('Value error should have been raised')
     except ACPCalendarException as e:
         self.assertEqual('Start date precedes the first registered holiday', str(e))
예제 #3
0
 def test_validate_dates_last_holiday(self):
     first_holiday = ACPHoliday.objects.all().first()
     last_holiday = ACPHoliday.objects.all().last()
     try:
         ACPHoliday.validate_dates(first_holiday.date, last_holiday.date + datetime.timedelta(days=1))
         self.fail('Value error should have been raised')
     except ValueError as e:
         self.assertEqual('End date exceed the last registered holiday', str(e))
예제 #4
0
 def test_validate_dates_last_holiday(self):
     first_holiday = ACPHoliday.objects.all().first()
     last_holiday = ACPHoliday.objects.all().last()
     try:
         ACPHoliday.validate_dates(
             first_holiday.date,
             last_holiday.date + datetime.timedelta(days=1))
         self.fail('Value error should have been raised')
     except ValueError as e:
         self.assertEqual('End date exceed the last registered holiday',
                          str(e))