Example #1
0
 def setUp(self):
     TestScript.setUp(self)
     location = Location.objects.get(code='de')
     facilitytype = SupplyPointType.objects.get(code='hc')
     facility, created = SupplyPoint.objects.get_or_create(
         code='dedh',
         name='Dangme East District Hospital',
         location=location,
         active=True,
         type=facilitytype,
         supplied_by=None)
     mc = Product.objects.get(sms_code='mc')
     lf = Product.objects.get(sms_code='lf')
     mg = Product.objects.get(sms_code='mg')
     ng = Product.objects.get(sms_code='ng')
     ProductStock(is_active=True,
                  product=mc,
                  supply_point=facility,
                  monthly_consumption=5).save()
     ProductStock(is_active=True,
                  product=lf,
                  supply_point=facility,
                  monthly_consumption=5).save()
     ProductStock(is_active=True,
                  product=mg,
                  supply_point=facility,
                  monthly_consumption=5).save()
     ProductStock(is_active=False,
                  product=ng,
                  supply_point=facility,
                  monthly_consumption=5).save()
     contact = register_user(self, "888", "testuser", "dedh")
     contact.commodities.add(mc)
     contact.commodities.add(lf)
Example #2
0
 def setUp(self):
     settings.LOGISTICS_STOCKED_BY = 'user'
     TestScript.setUp(self)
     load_test_data()
     self.facility = SupplyPoint.objects.get(code='dedh')
     prod_type = ProductType.objects.all()[0]
     self.commodity, created = Product.objects.get_or_create(
       sms_code='ab', name='Drug A', type=prod_type, units='cycle')
     self.commodity2, created = Product.objects.get_or_create(
       sms_code='cd', name='Drug B', type=prod_type, units='cycle')
     self.contact = register_user(self, '8282', 'tester', self.facility.code, self.facility.name)
Example #3
0
 def setUp(self):
     TestScript.setUp(self)
     location = Location.objects.get(code='de')
     facilitytype = SupplyPointType.objects.get(code='hc')
     facility, created = SupplyPoint.objects.get_or_create(code='dedh',
                                     name='Dangme East District Hospital',
                                     location=location, active=True,
                                     type=facilitytype, supplied_by=None)
     mc = Product.objects.get(sms_code='mc')
     lf = Product.objects.get(sms_code='lf')
     mg = Product.objects.get(sms_code='mg')
     ng = Product.objects.get(sms_code='ng')
     ProductStock(is_active=True, product=mc, supply_point=facility,
                  monthly_consumption=5).save()
     ProductStock(is_active=True, product=lf, supply_point=facility,
                  monthly_consumption=5).save()
     ProductStock(is_active=True, product=mg, supply_point=facility,
                  monthly_consumption=5).save()
     ProductStock(is_active=False, product=ng, supply_point=facility,
                  monthly_consumption=5).save()
     contact = register_user(self, "888", "testuser", "dedh")
     contact.commodities.add(mc)
     contact.commodities.add(lf)