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

Method test_success

tests/test_router_verify.py:167–179  ·  view source on GitHub ↗
(
        self,
        async_method_mocker: AsyncMethodMocker,
        test_app_client: httpx.AsyncClient,
        user_manager: UserManagerMock,
        user: UserModel,
    )

Source from the content-addressed store, hash-verified

165 assert data["detail"] == ErrorCode.VERIFY_USER_ALREADY_VERIFIED
166
167 async def test_success(
168 self,
169 async_method_mocker: AsyncMethodMocker,
170 test_app_client: httpx.AsyncClient,
171 user_manager: UserManagerMock,
172 user: UserModel,
173 ):
174 async_method_mocker(user_manager, "verify", return_value=user)
175 response = await test_app_client.post("/verify", json={"token": "foo"})
176
177 assert response.status_code == status.HTTP_200_OK
178 data = cast(dict[str, Any], response.json())
179 assert data["id"] == str(user.id)
180
181 async def test_verify_namespace(
182 self,

Callers

nothing calls this directly

Calls 1

async_method_mockerFunction · 0.85

Tested by

no test coverage detected