Rewrite test_uppercase_scheme_redirect to use local httpbin

Instead of redirecting to hard-coded 'example.com', use the URL
defined in `HTTPBIN_URL` with the path set to the 'html' endpoint.
This commit is contained in:
David Pursehouse
2013-07-24 17:18:16 +09:00
parent c4f16c351c
commit 56b5f02551
+3 -1
View File
@@ -554,7 +554,9 @@ class RequestsTestCase(unittest.TestCase):
)
def test_uppercase_scheme_redirect(self):
r = requests.get(httpbin('redirect-to'), params={'url': 'HTTP://example.com/'})
parts = urlparse(httpbin('html'))
url = "HTTP://" + parts.netloc + parts.path
r = requests.get(httpbin('redirect-to'), params={'url': url})
self.assertEqual(r.status_code, 200)
def test_transport_adapter_ordering(self):