コード例 #1
0
 def testSyncRequisition(self):
     with open(os.path.join(self.datapath, 'sample_program.json')) as f:
         lmis_program = Program.from_json(json.loads(f.read()))
     commtrack_program = sync_openlmis_program(TEST_DOMAIN, lmis_program)
     test_product = {
         'name': 'Test',
         'code': 'P151',
         'unit': 10,
         'description': 'decs',
         'category': 'category',
     }
     sync_openlmis_product(TEST_DOMAIN, commtrack_program, test_product)
     sync_requisition_from_openlmis(TEST_DOMAIN, 1, self.api)
     self.assertTrue(1, len(RequisitionCase.get_by_external(TEST_DOMAIN, 1)))
コード例 #2
0
 def fixmetestSyncRequisition(self):
     with open(os.path.join(self.datapath, 'sample_program.json')) as f:
         lmis_program = Program.from_json(json.loads(f.read()))
     commtrack_program = sync_openlmis_program(TEST_DOMAIN, lmis_program)
     test_product = LMISProduct.from_json({
         "programCode": "ESS_MEDS",
         "programName": "ESSENTIAL MEDICINES",
         "productCode": "P26",
         "productName": "Erythromycin ethyl succinate, pwd oral suspension, 125mg/5ml",
         "description": "TDF/FTC/EFV",
         "unit": 10,
         "category": "Analgesics"
     })
     sync_openlmis_product(TEST_DOMAIN, commtrack_program, test_product)
     sync_requisition_from_openlmis(TEST_DOMAIN, 1, self.api)
     self.assertTrue(1, len(RequisitionCase.get_by_external(TEST_DOMAIN, 1)))
コード例 #3
0
 def fixmetestSyncRequisition(self):
     with open(os.path.join(self.datapath, 'sample_program.json')) as f:
         lmis_program = Program.from_json(json.loads(f.read()))
     commtrack_program = sync_openlmis_program(TEST_DOMAIN, lmis_program)
     test_product = LMISProduct.from_json({
         "programCode": "ESS_MEDS",
         "programName": "ESSENTIAL MEDICINES",
         "productCode": "P26",
         "productName":
         "Erythromycin ethyl succinate, pwd oral suspension, 125mg/5ml",
         "description": "TDF/FTC/EFV",
         "unit": 10,
         "category": "Analgesics"
     })
     sync_openlmis_product(TEST_DOMAIN, commtrack_program, test_product)
     sync_requisition_from_openlmis(TEST_DOMAIN, 1, self.api)
     self.assertTrue(1, len(RequisitionCase.get_by_external(TEST_DOMAIN,
                                                            1)))