mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-25 21:41:27 +00:00
test(tokens-repo): check refreshed token validity by trying to auth
This commit is contained in:
parent
270e569af2
commit
07fe2f8a55
|
@ -5,11 +5,6 @@ import datetime
|
||||||
import pytest
|
import pytest
|
||||||
from mnemonic import Mnemonic
|
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
|
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")
|
response = authorized_client.post("/auth/tokens")
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
new_token = response.json()["token"]
|
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
|
# new device
|
||||||
|
|
Loading…
Reference in a new issue