Exemplo n.º 1
0
 def submit_xml_form(self, xml_method, timestamp=None, date_formatter=json_format_datetime, **submit_extras):
     instance_id = uuid.uuid4().hex
     instance = submission_wrap(
         instance_id,
         self.products,
         self.user,
         self.sp.case_id,
         self.sp2.case_id,
         xml_method,
         timestamp=timestamp,
         date_formatter=date_formatter,
     )
     submit_form_locally(instance=instance, domain=self.domain.name, **submit_extras)
     return instance_id
Exemplo n.º 2
0
 def submit_xml_form(self, xml_method, **submit_extras):
     instance_id = uuid.uuid4().hex
     instance = submission_wrap(
         instance_id,
         self.products,
         self.user,
         self.sp,
         self.sp2,
         xml_method,
     )
     submit_form_locally(instance=instance,
                         domain=self.domain.name,
                         **submit_extras)
     return instance_id
Exemplo n.º 3
0
 def submit_xml_form(self, xml_method, **submit_extras):
     from casexml.apps.case import settings
     settings.CASEXML_FORCE_DOMAIN_CHECK = False
     instance = submission_wrap(
         self.products,
         self.user,
         self.sp,
         self.sp2,
         xml_method,
     )
     submit_form_locally(
         instance=instance,
         domain=self.domain.name,
         **submit_extras
     )
Exemplo n.º 4
0
 def submit_xml_form(self, xml_method, **submit_extras):
     instance_id = uuid.uuid4().hex
     instance = submission_wrap(
         instance_id,
         self.products,
         self.user,
         self.sp,
         self.sp2,
         xml_method,
     )
     submit_form_locally(
         instance=instance,
         domain=self.domain.name,
         **submit_extras
     )
     return instance_id
Exemplo n.º 5
0
 def submit_xml_form(self, xml_method, **submit_extras):
     from casexml.apps.case import settings
     settings.CASEXML_FORCE_DOMAIN_CHECK = False
     instance_id = uuid.uuid4().hex
     instance = submission_wrap(
         instance_id,
         self.products,
         self.user,
         self.sp,
         self.sp2,
         xml_method,
     )
     submit_form_locally(instance=instance,
                         domain=self.domain.name,
                         **submit_extras)
     return instance_id
Exemplo n.º 6
0
 def submit_xml_form(self, xml_method, timestamp=None, date_formatter=json_format_datetime, **submit_extras):
     instance_id = uuid.uuid4().hex
     instance = submission_wrap(
         instance_id,
         self.products,
         self.user,
         self.sp.case_id,
         self.sp2.case_id,
         xml_method,
         timestamp=timestamp,
         date_formatter=date_formatter,
     )
     submit_form_locally(
         instance=instance,
         domain=self.domain.name,
         **submit_extras
     )
     return instance_id
Exemplo n.º 7
0
 def test_submit_bad_case_id(self):
     instance_id = uuid.uuid4().hex
     amounts = [(p._id, float(i*10)) for i, p in enumerate(self.products)]
     xml_stub = balance_submission(amounts)
     instance = submission_wrap(
         instance_id,
         self.products,
         self.user,
         'missing',
         'missing-too',
         xml_stub,
     )
     submit_form_locally(
         instance=instance,
         domain=self.domain.name,
     )
     form = XFormInstance.get(instance_id)
     self.assertEqual('XFormError', form.doc_type)
     self.assertTrue('IllegalCaseId' in form.problem)
Exemplo n.º 8
0
 def submit_xml_form(self,
                     xml_method,
                     timestamp=None,
                     date_formatter=json_format_datetime,
                     device_id='351746051189879',
                     **submit_extras):
     instance_id = uuid.uuid4().hex
     instance = submission_wrap(
         instance_id,
         self.products,
         self.user,
         self.sp.case_id,
         self.sp2.case_id,
         xml_method,
         timestamp=timestamp,
         date_formatter=date_formatter,
         device_id=device_id,
     )
     with self.process_legder_changes:
         submit_form_locally(instance=instance,
                             domain=self.domain.name,
                             **submit_extras)
     return instance_id