diff options
author | Alexander Nelzin <asnelzin@gmail.com> | 2014-11-12 15:23:23 +0300 |
---|---|---|
committer | Alexander Nelzin <asnelzin@gmail.com> | 2014-11-12 15:23:23 +0300 |
commit | 34f6088c8f3f2bac942c84ce2ffa92dfdee5aa4e (patch) | |
tree | ff3c81075ffa14d3b01ae05a60e1c0467fcdd328 | |
parent | 431282e77888e6601991d8c1e2481b3692f4194a (diff) | |
download | python-requests-34f6088c8f3f2bac942c84ce2ffa92dfdee5aa4e.tar.gz |
Added test for overriding Content-Length.
-rwxr-xr-x | test_requests.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test_requests.py b/test_requests.py index b2e12d06..4a05cb2e 100755 --- a/test_requests.py +++ b/test_requests.py @@ -103,6 +103,14 @@ class RequestsTestCase(unittest.TestCase): head_req = requests.Request('HEAD', httpbin('head')).prepare() assert 'Content-Length' not in head_req.headers + def test_override_content_length(self): + headers = { + 'Content-Length': 'not zero' + } + r = requests.Request('POST', httpbin('post'), headers=headers).prepare() + assert 'Content-Length' in r.headers + assert r.headers['Content-Length'] == 'not zero' + def test_path_is_not_double_encoded(self): request = requests.Request('GET', "http://0.0.0.0/get/test case").prepare() |