Esempio n. 1
0
 def test_detener_tarea_para_cambiarle_el_estado_y_liberar_su_timer_temporal(self):
     user = User.objects.create(username="******", password="******")
     
     t = TaskFactory(user=user)
     
     start_task(t)
     stop_task(t)
     tasks_stopped = Task.objects.filter(started=False).count()
     self.assertEqual(tasks_stopped,1)
     temporal_timer = t.current_timer
     self.assertEqual(temporal_timer, None)
     timers = Timer.objects.all().count()
     self.assertEqual(timers, 2)
Esempio n. 2
0
    def test_iniciar_tarea_para_cambiarle_el_estado_y_asignarle_un_timer(self):

        user = User.objects.create(username="******", password="******")
        
        t = TaskFactory(user=user)
        
        start_task(t)
        tasks_started = Task.objects.filter(started=True).count()
        self.assertEqual(tasks_started, 1)
        temporal_timer = t.current_timer
        self.assertEqual(temporal_timer, Timer.objects.all()[1])
        timers = Timer.objects.all().count()
        self.assertEqual(timers, 2)