File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
services/web/server/tests/unit/with_dbs/03 Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,7 @@ async def private_user(client: TestClient) -> AsyncIterable[UserInfoDict]:
8080async def public_user (client : TestClient ) -> AsyncIterable [UserInfoDict ]:
8181 assert client .app
8282 async with NewUser (
83+ app = client .app ,
8384 user_data = {
8485 "name" : "taylie01" ,
8586 "first_name" : "Taylor" ,
@@ -139,12 +140,16 @@ async def test_search_users(
139140 found = TypeAdapter (list [UserGet ]).validate_python (data )
140141 assert found
141142 assert len (found ) == 2
142- assert found [1 ].user_id == public_user ["id" ]
143+
144+ index = [u .user_id for u in found ].index (public_user ["id" ])
145+ assert found [index ].user_name == public_user ["name" ]
146+
143147 # check privacy
144- assert found [0 ].user_name == private_user ["name" ]
145- assert found [0 ].email is None
146- assert found [0 ].first_name is None
147- assert found [0 ].last_name is None
148+ index = (index + 1 ) % 2
149+ assert found [index ].user_name == private_user ["name" ]
150+ assert found [index ].email is None
151+ assert found [index ].first_name is None
152+ assert found [index ].last_name is None
148153
149154 # SEARCH user for admin (from a USER)
150155 url = (
You can’t perform that action at this time.
0 commit comments