Exemplo n.º 1
0
 def setUp(self):
     UserTest.setUp(self)
     self.user_production = UserProduction(
         user_id=self.user.id,
         concept="Test Production",
         quantity=10,
         date=date.today()
     )
     self.user_production.add()
     user_production2 = UserProduction(
         user_id=self.user.id,
         concept="Test Production",
         quantity=10,
         date=date.today() + timedelta(days=10)
     )
     user_production2.add()
     self.user_activity = UserActivity(
         user_id=self.user.id,
         title="Test Activity"
     )
     self.user_activity.add()
     self.order = Order(
         user_id=self.user.id,
         title="Test Activity",
         status="Cancelada",
         due_date=date.today()
     )
     self.order.add()
     order2 = Order(
         user_id=self.user.id,
         title="Test Activity",
         status="Pendiente",
         due_date=date.today() + timedelta(days=10)
     )
     order2.add()
Exemplo n.º 2
0
class TestGetFinishedWeekOrders(UserScheduleTest):

    def setUp(self):
        UserScheduleTest.setUp(self)
        self.finished_order = Order(
            user_id=self.user.id,
            title="Test Activity",
            status="Completada",
            due_date=date.today()
        )
        self.finished_order.add()

    def test_should_return_all_finished_week_orders_given_date(self):
        week_finished_orders = self.user.schedule.get_finished_week_orders(
            date.today()
        )

        self.assertEqual(week_finished_orders, [self.finished_order])

    def test_should_not_return_finished_orders_given_no_orders_scheduled_for_given_week(self):
        week_finished_orders = self.user.schedule.get_finished_week_orders(
            date.today() - timedelta(days=10)
        )

        self.assertEqual(week_finished_orders, [])
Exemplo n.º 3
0
class OrderTest(Test):

    def setUp(self):
        Test.setUp(self)
        self.user = User(
            username="******",
            password="******"
        )
        self.user.add()
        self.order = Order(
            user_id=self.user.id,
            title="Test Title",
            description="Test Description",
            due_date=date.today()
        )
        self.order.add()