Changeset 3897
- Timestamp:
- 01/12/08 16:03:27 (7 months ago)
- Files:
-
- trunk/tg/controllers.py (modified) (2 diffs)
- trunk/tg/tests/test_tg_controller_dispatch.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/tg/controllers.py
r3890 r3897 19 19 return self._perform_call(None, None) 20 20 21 def redirect(url, params= {}, **kw):21 def redirect(url, params=None, **kw): 22 22 """Generate an HTTP redirect. The function raises an exception internally, 23 23 which is handled by the framework. The URL may be either absolute (e.g. … … 28 28 request. 29 29 """ 30 if not params: 31 params = {} 30 32 url = urlparse.urljoin(request.path_info, url) 31 33 params.update(kw) trunk/tg/tests/test_tg_controller_dispatch.py
r3893 r3897 11 11 class SubController(object): 12 12 @expose() 13 def foo(self ):13 def foo(self,): 14 14 return 'sub_foo' 15 15 … … 37 37 class BasicTGController(TurboGearsController): 38 38 @expose() 39 def index(self ):39 def index(self, **kwargs): 40 40 return 'hello world' 41 41 … … 137 137 138 138 def test_subcontroller_redirect_subindex(self): 139 resp=self.app.get('/sub/redirect_sub') 139 resp=self.app.get('/sub/redirect_sub').follow() 140 140 self.failUnless('sub index' in resp) 141 141