Esempio n. 1
0
    def test_vanilla_form(self, config):
        user_id = str(uuid4())
        form_id = str(uuid4())
        result = post_form_xml(config.receiver_url, config.domain, form_id=form_id,
                user_id=user_id
        )

        assert result.status_code == 201
        assert result.text == OPEN_ROSA_SUCCESS_RESPONSE
Esempio n. 2
0
def post_case_blocks(endpoint_url, case_blocks, form_extras=None, domain=None):
    """
    Post case blocks.

    Extras is used to add runtime attributes to the form before
    sending it off to the case (current use case is sync-token pairing)
    """
    domain = domain or form_extras.pop('domain', None)
    assert domain is not None
    if form_extras is None:
        form_extras = {}

    return post_form_xml(
        endpoint_url,
        domain,
        case_blocks=[cb.as_xml() for cb in case_blocks] if case_blocks else '',
        form_id=form_extras.get('form_id', None),
        username=form_extras.get('username', None),
        user_id=form_extras.get('user_id', None),
        headers=form_extras.get('headers', None),
        )