Пример #1
0
 def setUpTestData(cls):
     cls.client1 = ClientFactory()
     cls.billed_orders = OrderFactory.create_batch(
         10,
         delivery_date=datetime.datetime.today(),
         client=cls.client1, status="D", )
     cls.orders = OrderFactory.create_batch(
         10,
         delivery_date=datetime.datetime.today(),
         client=ClientFactory(),
         status="O",
     )
Пример #2
0
 def setUpTestData(cls):
     cls.client1 = ClientFactory()
     cls.billed_orders = OrderFactory.create_batch(
         10,
         delivery_date=datetime.datetime.today(),
         client=cls.client1,
         status="D",
     )
     cls.orders = OrderFactory.create_batch(
         10,
         delivery_date=datetime.datetime.today(),
         client=ClientFactory(),
         status="O",
     )
Пример #3
0
 def handle(self, *args, **options):
     orders = OrderFactory.create_batch(500, status='D')
     self.stdout.write(
         self.style.SUCCESS(
             'Successfully created client {} orders'.format(orders)
         )
     )
Пример #4
0
 def setUp(self):
     self.today = datetime.datetime.today()
     self.billable_orders = OrderFactory.create_batch(
         10,
         delivery_date=self.today,
         status="D",
     )
Пример #5
0
 def setUp(self):
     super().setUp()
     self.account = AccountFactory(
         user=self.user,
         role=RoleFactory(priority=RolePriority.PHYSICIAN.value))
     self.product = ProductFactory()
     preference = PreferenceFactory(
         client=self.account.client,
         questions=QuestionFactory.create_batch(3))
     self.question_1, self.question_2, self.question_3 = preference.questions.all(
     )
     OrderFactory.create_batch(2,
                               physician=self.account,
                               product=self.product,
                               preference_questions=(self.question_1,
                                                     self.question_2))
     OrderFactory.create_batch(3,
                               physician=self.account,
                               product=self.product,
                               preference_questions=(self.question_2,
                                                     self.question_3))
     self.path = reverse('api:hospital:order:order_preferences',
                         args=(self.account.client.id, self.product.id))
Пример #6
0
    def setUp(self):
        super().setUp()
        specialty = SpecialtyFactory()
        self.account = AccountFactory.create(
            role=RoleFactory(priority=RolePriority.PHYSICIAN.value),
            user=self.user,
            specialties=(specialty, ))
        self.account_foo = AccountFactory.create(user=self.account.user,
                                                 specialties=(specialty, ))

        self.category_1 = CategoryFactory(specialty=specialty)
        self.category_2 = CategoryFactory(specialty=specialty)

        faker = Faker()
        self.category_1_orders = faker.random_int(min=1, max=20)
        self.category_2_orders = faker.random_int(min=1, max=20)
        self.other_orders = faker.random_int(min=1, max=20)
        self.total_num_orders = self.category_1_orders + self.category_2_orders + self.other_orders
        OrderFactory.create_batch(
            self.category_1_orders,
            physician=self.account,
            product=ProductFactory(category=self.category_1))
        OrderFactory.create_batch(
            self.category_2_orders,
            physician=self.account,
            product=ProductFactory(category=self.category_2))
        OrderFactory.create_batch(
            self.other_orders,
            physician=AccountFactory(client=self.account.client),
            product=ProductFactory(category=self.category_2))
        OrderFactory.create_batch(
            3,
            physician=self.account_foo,
            product=ProductFactory(category=self.category_1))

        self.path = reverse('api:hospital:order:ordersummary',
                            args=(self.account.client.id, ))
Пример #7
0
    def setUp(self):
        super().setUp()
        specialty = SpecialtyFactory()
        self.account = AccountFactory.create(
            role=RoleFactory(priority=RolePriority.PHYSICIAN.value),
            user=self.user,
            specialties=(specialty, ))

        self.category_1 = CategoryFactory(specialty=specialty)
        self.category_2 = CategoryFactory(specialty=specialty)
        self.manufacturer_1 = ManufacturerFactory(image=ImageField(
            filename='Abbott.jpg'))
        self.manufacturer_2 = ManufacturerFactory(image=ImageField(
            filename='Simon.jpg'))
        self.product_1 = ProductFactory(category=self.category_1,
                                        manufacturer=self.manufacturer_1)
        self.product_2 = ProductFactory(category=self.category_2,
                                        manufacturer=self.manufacturer_2)
        self.product_3 = ProductFactory(category=self.category_1,
                                        manufacturer=self.manufacturer_2)

        faker = Faker()
        self.product_1_orders = faker.random_int(min=1, max=5)
        self.category_2_orders = faker.random_int(min=1, max=4)
        self.other_orders = faker.random_int(min=1, max=3)
        self.total_num_orders = self.product_1_orders + self.category_2_orders + self.other_orders
        OrderFactory.create_batch(self.product_1_orders,
                                  physician=self.account,
                                  product=self.product_1)
        OrderFactory.create_batch(self.category_2_orders,
                                  physician=self.account,
                                  product=self.product_2)
        OrderFactory.create_batch(
            self.other_orders,
            physician=AccountFactory(client=self.account.client),
            product=self.product_3)
        self.path = reverse('api:hospital:order:ordersummary_by_category',
                            args=(self.account.client.id, self.category_1.id))
Пример #8
0
 def setUp(self):
     self.today = datetime.datetime.today()
     self.billable_orders = OrderFactory.create_batch(
         10, delivery_date=self.today, status="D", )
Пример #9
0
 def handle(self, *args, **options):
     orders = OrderFactory.create_batch(500, status='D')
     self.stdout.write(
         self.style.SUCCESS(
             'Successfully created client {} orders'.format(orders)))