def test_execute_schedule_task_not_found(self): OtherStuffFactory() schedule = Schedule.objects.filter(verb=DUMMY_EVENT).first() self.assertEqual(0, schedule.counter) schedule_pk = execute_schedule_task(0) self.assertIsNone(schedule_pk) schedule.refresh_from_db() self.assertEqual(0, schedule.counter)
def test_clean_scheduled_tasks(self): OtherStuffFactory() schedule = Schedule.objects.filter(verb=DUMMY_EVENT).first() execute_schedule_task(schedule.pk) clean_scheduled_tasks() self.assertEqual(0, Schedule.objects.filter(verb=DUMMY_EVENT).count())