mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-15 23:23:17 +00:00
test(tokens-repo): check refreshed token validity by trying to auth
This commit is contained in:
parent
7b5fb4b2df
commit
cb46c5e43b
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue