diff --git a/tests/adapters/test_redirects.py b/tests/adapters/test_redirects.py index 56ee9197..3197cc3a 100644 --- a/tests/adapters/test_redirects.py +++ b/tests/adapters/test_redirects.py @@ -108,6 +108,15 @@ async def test_redirect_303(): assert len(response.history) == 1 +@pytest.mark.asyncio +async def test_disallow_redirects(): + client = RedirectAdapter(MockDispatch()) + response = await client.request("POST", "https://example.org/redirect_303", allow_redirects=False) + assert response.status_code == codes.see_other + assert response.url == URL("https://example.org/redirect_303") + assert len(response.history) == 0 + + @pytest.mark.asyncio async def test_relative_redirect(): client = RedirectAdapter(MockDispatch())