def async_create_case(upload_id): """ Task backend for sonosite upload """ upload_doc = SonositeUpload.get(upload_id) files = get_files_from_doc(upload_doc) create_case(upload_doc.related_case_id, files) upload_doc.delete()
def testUpload(self): result = utils.create_case(self.case_id, self.files, self.case_id) self.assertEqual(len(result), 1) case = result[0] self.assertEqual(case.type, 'sonosite_upload') self.assertEqual(len(case.case_attachments), 3) self.assertEqual(case.patient_case_id, self.case_id) self.assertEqual(self.case_id, case.indices[0].referenced_id) self.assertEqual('child', case.indices[0].referenced_type) self.assertEqual('patient_id', case.indices[0].identifier)