mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
update 307 tests to check body content
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user