MCPcopy Create free account
hub / github.com/fastapi-users/fastapi-users / test_verified_user

Method test_verified_user

tests/test_router_users.py:87–99  ·  view source on GitHub ↗
(
        self,
        test_app_client: tuple[httpx.AsyncClient, bool],
        verified_user: UserModel,
    )

Source from the content-addressed store, hash-verified

85 assert data["email"] == user.email
86
87 async def test_verified_user(
88 self,
89 test_app_client: tuple[httpx.AsyncClient, bool],
90 verified_user: UserModel,
91 ):
92 client, _ = test_app_client
93 response = await client.get(
94 "/me", headers={"Authorization": f"Bearer {verified_user.id}"}
95 )
96 assert response.status_code == status.HTTP_200_OK
97 data = cast(dict[str, Any], response.json())
98 assert data["id"] == str(verified_user.id)
99 assert data["email"] == verified_user.email
100
101 async def test_current_user_namespace(self, app_factory):
102 assert app_factory(True).url_path_for("users:current_user") == "/me"

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected