diff --git a/services/web/server/tests/unit/with_dbs/03/test_users__tokens.py b/services/web/server/tests/unit/with_dbs/03/test_users__tokens.py index 315f4884bc0..d4f3aff5614 100644 --- a/services/web/server/tests/unit/with_dbs/03/test_users__tokens.py +++ b/services/web/server/tests/unit/with_dbs/03/test_users__tokens.py @@ -7,8 +7,10 @@ import random from collections.abc import AsyncIterator +from copy import deepcopy from http import HTTPStatus from itertools import repeat +from uuid import UUID import pytest from aiohttp.test_utils import TestClient @@ -145,16 +147,18 @@ async def test_read_token( data, error = await assert_status(resp, expected) if not error: - expected_token = random.choice(fake_tokens) + expected_token = deepcopy(random.choice(fake_tokens)) sid = expected_token["service"] # get one url = client.app.router["get_token"].url_for(service=sid) - assert "/v0/me/tokens/%s" % sid == str(url) + assert f"/v0/me/tokens/{sid}" == str(url) resp = await client.get(url.path) data, error = await assert_status(resp, expected) + expected_token["token_key"] = f'{UUID(expected_token["token_key"])}' + expected_token["token_secret"] = None assert data == expected_token, "list and read item are both read operations"