diff options
author | Joel Rivera <rivera@joel.mx> | 2016-03-14 23:40:52 -0600 |
---|---|---|
committer | Joel Rivera <rivera@joel.mx> | 2016-03-14 23:40:52 -0600 |
commit | f0a695152523fb033db561e2cca5c6e0a5a8846b (patch) | |
tree | 019217b8101e9837f9802996f45d9ab8b953385e | |
parent | ba9d145f66887a5b17e8931a9c3f55647d5317ea (diff) | |
download | cherrypy-f0a695152523fb033db561e2cca5c6e0a5a8846b.tar.gz |
Fix test_no_content_lenght in python2.6
-rw-r--r-- | cherrypy/test/test_http.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cherrypy/test/test_http.py b/cherrypy/test/test_http.py index ed0aabda..0df589fa 100644 --- a/cherrypy/test/test_http.py +++ b/cherrypy/test/test_http.py @@ -113,7 +113,10 @@ class HTTPTests(helper.CPWebCase): c = HTTPSConnection('%s:%s' % (self.interface(), self.PORT)) else: c = HTTPConnection('%s:%s' % (self.interface(), self.PORT)) - with patch.object(c, '_set_content_length'): + if hasattr(c, '_set_content_length'): # python 2.6 doesn't have it + with patch.object(c, '_set_content_length'): + c.request("POST", "/") + else: c.request("POST", "/") response = c.getresponse() self.body = response.fp.read() |