Test allow_redirects=False
This commit is contained in:
parent
05e0649e8f
commit
b392b7ea59
@ -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())
|
||||
|
||||
Loading…
Reference in New Issue
Block a user