def _auth_headers(tokens: dict) -> dict: return {"Authorization": f"Bearer {tokens['access_token']}"} def test_users_me(client, admin_tokens): response = client.get("/api/v1/users/me", headers=_auth_headers(admin_tokens)) assert response.status_code == 200 assert response.json()["username"] == "admin" def test_users_list(client, admin_tokens): listed = client.get("/api/v1/users/", headers=_auth_headers(admin_tokens)) assert listed.status_code == 200 usernames = [row["username"] for row in listed.json()["result"]] assert "admin" in usernames