From 423258636bc88fcba41ac59c96279007f31b23bd Mon Sep 17 00:00:00 2001 From: Stuart Fisher Date: Fri, 30 Sep 2022 08:37:41 +0200 Subject: [PATCH] lint --- pyispyb/app/extensions/auth/bearer.py | 2 +- tests/core/api/test_authentication.py | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/pyispyb/app/extensions/auth/bearer.py b/pyispyb/app/extensions/auth/bearer.py index bab0bcac..b9076696 100644 --- a/pyispyb/app/extensions/auth/bearer.py +++ b/pyispyb/app/extensions/auth/bearer.py @@ -4,7 +4,7 @@ from ...globals import g from .token import decode_token, set_token_data -from .onetime import expire_onetime_tokens, onetime, validate_onetime_token +from .onetime import onetime, validate_onetime_token # auto_error=False to correct 403 -> 401 # https://github.com/tiangolo/fastapi/issues/2026 diff --git a/tests/core/api/test_authentication.py b/tests/core/api/test_authentication.py index ea8c4f54..137e7bba 100644 --- a/tests/core/api/test_authentication.py +++ b/tests/core/api/test_authentication.py @@ -64,9 +64,3 @@ def test_onetime(client: TestClient): res = client.get(f"{settings.api_root}/events?onetime={res2.json()['token']}") assert res.status_code == 200 - - -def test_onetime_expired(client: TestClient): - res = client.get(f"{settings.api_root}/events?onetime=one") - assert res.status_code == 401 - assert "invalid" in res.json()["detail"].lower()