Skip to content

Commit

Permalink
fixes tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pcrespov committed Dec 17, 2024
1 parent f8e25ee commit 0ff2820
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions services/web/server/tests/unit/with_dbs/03/test_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ async def private_user(client: TestClient) -> AsyncIterable[UserInfoDict]:
async def public_user(client: TestClient) -> AsyncIterable[UserInfoDict]:
assert client.app
async with NewUser(
app=client.app,
user_data={
"name": "taylie01",
"first_name": "Taylor",
Expand Down Expand Up @@ -139,12 +140,16 @@ async def test_search_users(
found = TypeAdapter(list[UserGet]).validate_python(data)
assert found
assert len(found) == 2
assert found[1].user_id == public_user["id"]

index = [u.user_id for u in found].index(public_user["id"])
assert found[index].user_name == public_user["name"]

# check privacy
assert found[0].user_name == private_user["name"]
assert found[0].email is None
assert found[0].first_name is None
assert found[0].last_name is None
index = (index + 1) % 2
assert found[index].user_name == private_user["name"]
assert found[index].email is None
assert found[index].first_name is None
assert found[index].last_name is None

# SEARCH user for admin (from a USER)
url = (
Expand Down

0 comments on commit 0ff2820

Please sign in to comment.