From 7a1e089725ed103201bce187fba9d435e9c20d2c Mon Sep 17 00:00:00 2001 From: Suby Raman Date: Sat, 14 Jan 2017 00:45:04 -0500 Subject: [PATCH] add headers none test --- tests/test_requests.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_requests.py b/tests/test_requests.py index e88b5e28..b2ee8e78 100644 --- a/tests/test_requests.py +++ b/tests/test_requests.py @@ -224,6 +224,17 @@ def test_redirect_default_302(redirect_app): assert response.headers["Content-Type"] == 'text/html; charset=utf-8' +def test_redirect_headers_none(redirect_app): + request, response = sanic_endpoint_test( + redirect_app, method="get", + uri="/redirect_init", + headers=None, + allow_redirects=False) + + assert response.status == 302 + assert response.headers["Location"] == "/redirect_target" + + def test_redirect_with_301(redirect_app): """ Test redirection with a different status code.