Ticket #1407: internal_redirect.patch
| File internal_redirect.patch, 1.4 kB (added by simonk, 1 year ago) |
|---|
-
tests/test_controllers.py
old new 161 161 flash_redirected = turbogears.expose(html=".simple", 162 162 allow_json=True)(flash_redirected) 163 163 164 def internal_redirect(self, **kwargs): 165 raise cherrypy.InternalRedirect('/internal_redirect_target') 166 internal_redirect = turbogears.expose()(internal_redirect) 167 168 def internal_redirect_target(self, **kwargs): 169 return "redirected OK" 170 internal_redirect_target = turbogears.expose()(internal_redirect_target) 164 171 165 172 class TestRoot(unittest.TestCase): 166 173 def setUp(self): … … 406 413 assert not cherrypy.root.serve_exceptions 407 414 #assert "AssertionError" not in outputcap.getvalue() 408 415 416 def test_internal_redirect(self): 417 testutil.createRequest("/internal_redirect") 418 firstline = cherrypy.response.body[0] 419 assert "redirected OK" in firstline 420 421 def test_internal_redirect_nested_variables(self): 422 testutil.createRequest("/internal_redirect?a.b=1&a.c=2") 423 firstline = cherrypy.response.body[0] 424 print firstline 425 assert "redirected OK" in firstline 426 427 428 409 429 class TestURLs(unittest.TestCase): 410 430 def setUp(self): 411 431 cherrypy.tree.mount_points = {}