def test_allowed_to_forward(self): """ If all criteria pass, the payload should be allowed to forward :return: """ case_id = uuid.uuid4().hex form_payload, cases = _create_case(domain=DOMAIN, case_id=case_id, owner_id=self.owner.get_id) repeater = OpenmrsRepeater() self.assertTrue(repeater.allowed_to_forward(form_payload))
def test_allowed_to_forward(self): """ If all criteria pass, the payload should be allowed to forward :return: """ case_id = uuid.uuid4().hex form_payload, cases = _create_case(domain=DOMAIN, case_id=case_id, owner_id=self.owner.get_id) repeater = OpenmrsRepeater() self.assertTrue(repeater.allowed_to_forward(form_payload))
def test_update_from_openmrs(self): """ payloads from OpenMRS should not be forwarded back to OpenMRS """ payload = XFormInstanceSQL( domain=DOMAIN, xmlns=XMLNS_OPENMRS, ) repeater = OpenmrsRepeater() self.assertFalse(repeater.allowed_to_forward(payload))
def test_update_from_openmrs(self): """ payloads from OpenMRS should not be forwarded back to OpenMRS """ payload = XFormInstanceSQL( domain=DOMAIN, xmlns=XMLNS_OPENMRS, ) repeater = OpenmrsRepeater() self.assertFalse(repeater.allowed_to_forward(payload))
def test_excluded_case_type(self): """ If the repeater has white-listed case types, excluded case types should not be forwarded """ case_id = uuid.uuid4().hex form_payload, cases = _create_case( domain=DOMAIN, case_id=case_id, case_type='notpatient', owner_id=self.owner.get_id ) repeater = OpenmrsRepeater() repeater.white_listed_case_types = ['patient'] self.assertFalse(repeater.allowed_to_forward(form_payload))
def test_excluded_case_type(self): """ If the repeater has white-listed case types, excluded case types should not be forwarded """ case_id = uuid.uuid4().hex form_payload, cases = _create_case( domain=DOMAIN, case_id=case_id, case_type='notpatient', owner_id=self.owner.get_id ) repeater = OpenmrsRepeater() repeater.white_listed_case_types = ['patient'] self.assertFalse(repeater.allowed_to_forward(form_payload))