(
self,
async_method_mocker: AsyncMethodMocker,
test_app_client: httpx.AsyncClient,
oauth_client: BaseOAuth2,
)
| 88 | @pytest.mark.asyncio |
| 89 | class TestAuthorize: |
| 90 | async def test_success( |
| 91 | self, |
| 92 | async_method_mocker: AsyncMethodMocker, |
| 93 | test_app_client: httpx.AsyncClient, |
| 94 | oauth_client: BaseOAuth2, |
| 95 | ): |
| 96 | get_authorization_url_mock = async_method_mocker( |
| 97 | oauth_client, "get_authorization_url", return_value="AUTHORIZATION_URL" |
| 98 | ) |
| 99 | |
| 100 | response = await test_app_client.get( |
| 101 | "/oauth/authorize", params={"scopes": ["scope1", "scope2"]} |
| 102 | ) |
| 103 | |
| 104 | assert response.status_code == status.HTTP_200_OK |
| 105 | get_authorization_url_mock.assert_called_once() |
| 106 | |
| 107 | data = response.json() |
| 108 | assert "authorization_url" in data |
| 109 | |
| 110 | assert response.cookies.get("fastapiusersoauthcsrf") is not None |
| 111 | |
| 112 | async def test_with_redirect_url( |
| 113 | self, |
nothing calls this directly
no test coverage detected