update 307 tests to check body content

This commit is contained in:
Nate Prewitt
2016-11-02 10:09:31 -06:00
parent 38dd089c5f
commit 522d37c959
+5 -6
View File
@@ -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: