Exemplo n.º 1
0
    def test_calcular_costo_para_obtener_el_valor_total_por_una_tarea_con_todos_sus_tiempos(self):
        user = User.objects.create(username="******",password="******")
        
        t1 = TaskFactory(user=user)

        t1.current_timer = TimerFactory(task=t1, initial_time=datetime(2013, 10, 31, 17, 56, 1, 0),
                final_time=datetime(2013, 10, 31, 18, 56, 1, 0))
       
        t1.current_timer = TimerFactory(task=t1, initial_time=datetime(2013, 10, 31, 18, 56, 1, 0),
                final_time=datetime(2013, 10, 31, 19, 56, 1, 0))
        
        result = t1.calculate_cost()
        self.assertEqual(result,8000)