From cb46c5e43be7def018bb201c255e0c76428cc612 Mon Sep 17 00:00:00 2001 From: Houkime <> Date: Wed, 28 Dec 2022 15:43:43 +0000 Subject: [PATCH] test(tokens-repo): check refreshed token validity by trying to auth --- tests/test_rest_endpoints/test_auth.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tests/test_rest_endpoints/test_auth.py b/tests/test_rest_endpoints/test_auth.py index 6199265..44b543d 100644 --- a/tests/test_rest_endpoints/test_auth.py +++ b/tests/test_rest_endpoints/test_auth.py @@ -5,11 +5,6 @@ import datetime import pytest from mnemonic import Mnemonic -from selfprivacy_api.repositories.tokens.json_tokens_repository import ( - JsonTokensRepository, -) - -TOKEN_REPO = JsonTokensRepository() from tests.common import read_json, write_json @@ -105,7 +100,8 @@ def test_refresh_token(authorized_client, tokens_file): response = authorized_client.post("/auth/tokens") assert response.status_code == 200 new_token = response.json()["token"] - assert TOKEN_REPO.get_token_by_token_string(new_token) is not None + authorized_client.headers.update({"Authorization": "Bearer " + new_token}) + assert rest_get_tokens_info(authorized_client) is not None # new device