enabled test_web.py in PY3

This commit is contained in:
ilvalle
2016-06-22 19:07:58 +02:00
parent 3270d39596
commit 61795bc65e
4 changed files with 10 additions and 8 deletions
+4 -4
View File
@@ -137,7 +137,10 @@ class WebClient(object):
self.status = None
self.text = to_native(self.response.read())
self.headers = dict(self.response.headers)
# In PY3 self.response.headers are case sensitive
self.headers = dict()
for h in self.response.headers:
self.headers[h.lower()] = self.response.headers[h]
# treat web2py tickets as special types of errors
if error is not None:
@@ -146,9 +149,6 @@ class WebClient(object):
else:
raise error
if 'Set-Cookie' in self.headers: #PY3
self.headers['set-cookie'] = self.headers['Set-Cookie']
# parse headers into cookies
self.cookies = {}
if 'set-cookie' in self.headers: