Skip to content
Myr

update 307 tests to check body content

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Nate Prewitt · committed by Nate Prewitt · parent 38dd089 · Browse files · 1 file+5 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−6 removed

  • tests:+5 added−6 removed

1 file+5 added−6 removed

modified:tests/test_requests.py+5 added-6 removed
164 unmodified lines
165 assert r.history[0].status_code == 302166 assert r.history[0].is_redirect167168 def test_HTTP_307_ALLOW_REDIRECT_POST(self, httpbin):169 parts = urlparse(httpbin('post'))170 url = "HTTP://" + parts.netloc + parts.path171 r = requests.post(httpbin('redirect-to'), data='test', params={'url': url, 'status_code': 307})169 r = requests.post(httpbin('redirect-to'), data='test', params={'url': 'post', 'status_code': 307})170 assert r.status_code == 200171 assert r.history[0].status_code == 307172 assert r.history[0].is_redirect173 assert r.json()['data'] == 'test'174175 def test_HTTP_307_ALLOW_REDIRECT_POST_WITH_SEEKABLE(self, httpbin):177 parts = urlparse(httpbin('post'))178 url = "HTTP://" + parts.netloc + parts.path179 r = requests.post(httpbin('redirect-to'), data=io.BytesIO(b'test'), params={'url': url, 'status_code': 307})176 byte_str = b'test'177 r = requests.post(httpbin('redirect-to'), data=io.BytesIO(byte_str), params={'url': 'post', 'status_code': 307})178 assert r.status_code == 200179 assert r.history[0].status_code == 307180 assert r.history[0].is_redirect181 assert r.json()['data'] == byte_str.decode('utf-8')182183 def test_HTTP_302_TOO_MANY_REDIRECTS(self, httpbin):184 try:185 requests.get(httpbin('relative-redirect', '50'))
1894 unmodified lines