Beispiel #1
0
    def test_isReminded_reminded(self):
        task = Task()
        task.dueDateTime = datetime.datetime.today() + datetime.timedelta(
            seconds=30)

        reminder = Reminder()
        reminder.setTime(0, 300)
        task.addReminder(reminder)

        occurrence = task.currentOccurrence()
        self.assertEqual(occurrence.isReminded(), True)
Beispiel #2
0
    def test_getNotifications_reminder(self):
        task = Task()
        task.title = "task 1"
        task.dueDateTime = datetime.datetime.today() + datetime.timedelta(
            seconds=30)

        reminder = Reminder()
        reminder.setTime(0, 10)
        task.addReminder(reminder)

        notifications = task.getNotifications()
        self.assertEqual(len(notifications), 2)
        self.assertEqual(notifications[0].task, task)
        self.assertEqual(notifications[0].message,
                         "task 'task 1': 0:00:10 before due time")
        self.assertEqual(notifications[1].task, task)
        self.assertEqual(notifications[1].message,
                         "task 'task 1' reached deadline")