Merge pull request 'debug avatar retrieve' (#10) from feature/debug-avatar into master
Reviewed-on: #10
This commit is contained in:
commit
a40ce94d8c
2 changed files with 7 additions and 1 deletions
|
|
@ -51,6 +51,12 @@ def test_get_users_public_info_bulk_fetches_and_caches(mock_get_client):
|
||||||
assert result[str(user_2)]["avatar"] is None
|
assert result[str(user_2)]["avatar"] is None
|
||||||
mock_httpx.request.assert_called_once()
|
mock_httpx.request.assert_called_once()
|
||||||
|
|
||||||
|
# The accounts service's actual filter param is `uuid_in` (single
|
||||||
|
# underscore) — `uuid__in` (Django-ORM style) gets rejected with a 400.
|
||||||
|
requested_url = mock_httpx.request.call_args.kwargs["url"]
|
||||||
|
assert "uuid_in=" in requested_url
|
||||||
|
assert "uuid__in=" not in requested_url
|
||||||
|
|
||||||
# Second call for the same UUIDs should be served entirely from cache.
|
# Second call for the same UUIDs should be served entirely from cache.
|
||||||
mock_get_client.reset_mock()
|
mock_get_client.reset_mock()
|
||||||
result_again = accounts_client.get_users_public_info_bulk([user_1, user_2])
|
result_again = accounts_client.get_users_public_info_bulk([user_1, user_2])
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ def get_users_public_info_bulk(uuids: list) -> dict[str, dict]:
|
||||||
uuid_in = ",".join(str(u) for u in uncached)
|
uuid_in = ",".join(str(u) for u in uncached)
|
||||||
response = client.get_httpx_client().request(
|
response = client.get_httpx_client().request(
|
||||||
method="get",
|
method="get",
|
||||||
url=f"/users/api/users/?uuid__in={uuid_in}",
|
url=f"/users/api/users/?uuid_in={uuid_in}",
|
||||||
)
|
)
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
for profile in response.json().get("results", []):
|
for profile in response.json().get("results", []):
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue