diff --git a/tests/test_requests.py b/tests/test_requests.py index 0ed79508..85c1b568 100755 --- a/tests/test_requests.py +++ b/tests/test_requests.py @@ -166,20 +166,19 @@ class TestRequests: assert r.history[0].is_redirect def test_HTTP_307_ALLOW_REDIRECT_POST(self, httpbin): - parts = urlparse(httpbin('post')) - url = "HTTP://" + parts.netloc + parts.path - r = requests.post(httpbin('redirect-to'), data='test', params={'url': url, 'status_code': 307}) + r = requests.post(httpbin('redirect-to'), data='test', params={'url': 'post', 'status_code': 307}) assert r.status_code == 200 assert r.history[0].status_code == 307 assert r.history[0].is_redirect + assert r.json()['data'] == 'test' def test_HTTP_307_ALLOW_REDIRECT_POST_WITH_SEEKABLE(self, httpbin): - parts = urlparse(httpbin('post')) - url = "HTTP://" + parts.netloc + parts.path - r = requests.post(httpbin('redirect-to'), data=io.BytesIO(b'test'), params={'url': url, 'status_code': 307}) + byte_str = b'test' + r = requests.post(httpbin('redirect-to'), data=io.BytesIO(byte_str), params={'url': 'post', 'status_code': 307}) assert r.status_code == 200 assert r.history[0].status_code == 307 assert r.history[0].is_redirect + assert r.json()['data'] == byte_str.decode('utf-8') def test_HTTP_302_TOO_MANY_REDIRECTS(self, httpbin): try: