@integration_authorization
@pytest.mark.parametrize('test_name,identifier,username,roles,allowed_actions,requested_actions,expected', TEST_INTEG_AUTHZ_DATA)
def test_authorized_user_integ(monkeypatch, app, jwt, test_name, identifier, username, roles, allowed_actions, requested_actions, expected):
    'Assert that the type of user authorization is correct, based on the expected outcome.'
    import flask
    token = helper_create_jwt(jwt, roles=roles, username=username)
    headers = {'Authorization': ('Bearer ' + token)}

    def mock_auth(one, two):
        return headers['Authorization']
    with app.test_request_context():
        monkeypatch.setattr('flask.request.headers.get', mock_auth)
        rv = authorized(identifier, jwt, ['view'])
    if (expected == HTTPStatus.OK):
        assert rv
    else:
        assert (not rv)
Assert that the type of user authorization is correct, based on the expected outcome.
@integration_authorization
@pytest.mark.parametrize('test_name,identifier,username,roles,allowed_actions,requested_actions,expected', TEST_INTEG_AUTHZ_DATA)
def test_authorized_user_integ(monkeypatch, app, jwt, test_name, identifier, username, roles, allowed_actions, requested_actions, expected):
    
    import flask
    token = helper_create_jwt(jwt, roles=roles, username=username)
    headers = {'Authorization': ('Bearer ' + token)}

    def mock_auth(one, two):
        return headers['Authorization']
    with app.test_request_context():
        monkeypatch.setattr('flask.request.headers.get', mock_auth)
        rv = authorized(identifier, jwt, ['view'])
    if (expected == HTTPStatus.OK):
        assert rv
    else:
        assert (not rv)