| 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, |