Ticket #1203 (closed defect: fixed)
testutil.call_with_request unusable with "raise redirect()"
|Reported by:||Felix.Schwarz||Owned by:||Chris Arndt|
Calls with testutil.call_with_request(method, request) will always fail if method() raises redirects (e.g. 'raise redirect("login")').
File "/home/fs/workspace/junkkiller/junkkiller/quarantine/controllers.py", line 28, in login
File "/usr/lib/python2.4/site-packages/turbogears/controllers.py", line 540, in redirect
File "/usr/lib/python2.4/site-packages/cherrypy/_cperror.py", line 90, in init
if cherrypy.response.version >= "1.1":
File "/usr/lib/python2.4/site-packages/cherrypy/init.py", line 43, in getattr
return getattr(childobject, name)
AttributeError?: 'Response' object has no attribute 'version'
The version attribute is normally set by cherrypy but call_with_request does not call these methods (which is okay!). In order to make call_with_request usable again, I propose adding the line 'cherrypy.serving.response.version = "1.1"' just below 'cherrypy.serving.response = _cphttptools.Response()' in testutil.call_with_request.
- Component changed from unassigned to TurboGears
- Milestone set to 1.1
- Owner changed from anonymous to Chris Arndt
- Status changed from new to assigned
- Keywords review added; re-test removed
- Milestone changed from __unclassified__ to 1.0.x bugfix