mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
Fixup Python 3 test failures.
This commit is contained in:
@@ -136,8 +136,8 @@ class SessionRedirectMixin(object):
|
||||
# urlparse in requote_uri will encode it with UTF-8 before quoting.
|
||||
# Because of this insanity, we need to fix it up ourselves by
|
||||
# sending the URL back to bytes ourselves.
|
||||
if is_py3 and isinstance(url, str):
|
||||
url = url.encode('latin1')
|
||||
if is_py3 and isinstance(location_url, str):
|
||||
location_url = location_url.encode('latin1')
|
||||
|
||||
# Facilitate relative 'location' headers, as allowed by RFC 7231.
|
||||
# (e.g. '/path/to/resource' instead of 'http://domain.tld/path/to/resource')
|
||||
|
||||
+1
-1
@@ -1653,7 +1653,7 @@ class TestRedirects:
|
||||
assert session.calls[-1] == send_call
|
||||
|
||||
@pytest.mark.skipif(is_py2, reason="requires python 3")
|
||||
def test_redirects_with_latin1_header(self):
|
||||
def test_redirects_with_latin1_header(self, httpbin):
|
||||
"""Test that redirect headers decoded with Latin 1 are correctly
|
||||
followed"""
|
||||
session = RedirectSession([303])
|
||||
|
||||
Reference in New Issue
Block a user