Skip to content
Myr

Test allow_redirects=False

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tom Christie · committed by Tom Christie · parent 05e0649 · Browse files · 1 file+9 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+9 added−0 removed

  • tests:+9 added−0 removed

1 file+9 added−0 removed

modified:tests/adapters/test_redirects.py+9 added
107 unmodified lines
108 assert len(response.history) == 1109110111@pytest.mark.asyncio112async def test_disallow_redirects():113 client = RedirectAdapter(MockDispatch())114 response = await client.request("POST", "https://example.org/redirect_303", allow_redirects=False)115 assert response.status_code == codes.see_other116 assert response.url == URL("https://example.org/redirect_303")117 assert len(response.history) == 0118119120@pytest.mark.asyncio121async def test_relative_redirect():122 client = RedirectAdapter(MockDispatch())123 response = await client.request("GET", "https://example.org/relative_redirect")124 assert response.status_code == codes.ok
90 unmodified lines