#1203: testutil.call_with_request unusable with "raise redirect()"
---------------------------+------------------------------------------------
 Reporter:  Felix.Schwarz  |       Owner:  anonymous
     Type:  defect         |      Status:  new      
 Priority:  normal         |   Milestone:           
Component:  unassigned     |     Version:  1.0b2    
 Severity:  normal         |    Keywords:           
---------------------------+------------------------------------------------
 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
     raise redirect(forward_url)
   File "/usr/lib/python2.4/site-packages/turbogears/controllers.py", line
 540, in redirect
     raise cherrypy.HTTPRedirect(
   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.

-- 
Ticket URL: <http://trac.turbogears.org/turbogears/ticket/1203>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development
--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"TurboGears Tickets" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears-tickets?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to