Ejemplo n.º 1
0
def test_expired_token(app):
    api_token = factories.ApiTokenFactory(expired=True)
    with app.test_request_context(
        "/", headers={"Authorization": "Bearer: {}".format(api_token.access_token)}
    ):
        with pytest.raises(AuthenticationFailed):
            HeaderAuthentication().authenticate()
Ejemplo n.º 2
0
def default_api_token():
    return factories.ApiTokenFactory()