Beispiel #1
0
 def test_should_return_true_for_reminder_after_deadline_type_if_today_is_three_days_after_deadline_2(
         self):
     # next week
     today = date(2011, 9, 13)
     reminder = Reminder(reminder_mode=ReminderMode.AFTER_DEADLINE, day=3)
     deadline = Deadline(frequency=Week(6), mode="That")
     self.assertTrue(reminder.should_be_send_on(deadline, today))
Beispiel #2
0
 def test_should_return_false_for_reminder_before_deadline_type_if_today_is_not_two_days_before_deadline(
         self):
     today = date(2011, 9, 9)
     # Sunday deadline
     reminder = Reminder(reminder_mode=ReminderMode.BEFORE_DEADLINE, day=1)
     deadline = Deadline(frequency=Week(7), mode="That")
     self.assertFalse(reminder.should_be_send_on(deadline, today))
Beispiel #3
0
 def test_should_return_true_for_reminder_before_deadline_type_if_today_is_on_weekend(
         self):
     # Case where deadline is in next week, but reminder is scheduled today
     today = date(2011, 9, 11)
     reminder = Reminder(reminder_mode=ReminderMode.BEFORE_DEADLINE, day=2)
     deadline = Deadline(frequency=Week(2), mode="That")
     self.assertTrue(reminder.should_be_send_on(deadline, today))
Beispiel #4
0
 def test_should_return_true_for_reminder_before_deadline_type_if_today_is_two_days_before_following_deadline(
         self):
     # same week
     today = date(2011, 9, 9)
     reminder = Reminder(reminder_mode=ReminderMode.BEFORE_DEADLINE, day=2)
     deadline = Deadline(frequency=Week(7), mode="Following")
     self.assertTrue(reminder.should_be_send_on(deadline, today))
Beispiel #5
0
 def test_should_return_false_for_reminder_on_deadline_type_if_today_is_not_on_deadline(
         self):
     today = date(2011, 9, 10)
     reminder = Reminder(reminder_mode=ReminderMode.ON_DEADLINE)
     deadline = Deadline(frequency=Week(5), mode="That")
     self.assertFalse(reminder.should_be_send_on(deadline, today))
Beispiel #6
0
 def test_should_return_true_if_deadline_is_last_day_of_the_month_and_today_28th_of_february(
         self):
     today = date(2018, 2, 28)
     reminder = Reminder(reminder_mode=ReminderMode.ON_DEADLINE)
     deadline = Deadline(frequency=Month(0), mode="That")
     self.assertTrue(reminder.should_be_send_on(deadline, today))