MCPcopy Index your code
hub / github.com/fastapi-users/fastapi-users / test_active_user

Method test_active_user

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

Source from the content-addressed store, hash-verified

68 assert response.status_code == status.HTTP_401_UNAUTHORIZED
69
70 async def test_active_user(
71 self,
72 test_app_client: tuple[httpx.AsyncClient, bool],
73 user: UserModel,
74 ):
75 client, requires_verification = test_app_client
76 response = await client.get(
77 "/me", headers={"Authorization": f"Bearer {user.id}"}
78 )
79 if requires_verification:
80 assert response.status_code == status.HTTP_403_FORBIDDEN
81 else:
82 assert response.status_code == status.HTTP_200_OK
83 data = cast(dict[str, Any], response.json())
84 assert data["id"] == str(user.id)
85 assert data["email"] == user.email
86
87 async def test_verified_user(
88 self,

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected