Changeset 1138
- Timestamp:
- 06/12/06 01:09:46
- Files:
-
- trunk/cherrypy/test/test_core.py (modified) (2 diffs)
- trunk/cherrypy/test/test_tools.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/test/test_core.py
r1134 r1138 134 134 return str(cherrypy.HTTPRedirect("/")) 135 135 136 137 136 def login_redir(): 138 137 if not getattr(cherrypy.request, "login", None): … … 162 161 raise cherrypy.InternalRedirect('/image/getImagesByUser') 163 162 163 # We support Python 2.3, but the @-deco syntax would look like this: 164 # @tools.login_redir.wrap() 164 165 def secure(self): 165 166 return "Welcome!" trunk/cherrypy/test/test_tools.py
r1134 r1138 76 76 77 77 # METHOD FOUR: decorator using Tool.enable 78 @tools.base_url.enable() 78 # We support Python 2.3, but the @-deco syntax would look like this: 79 # @tools.base_url.enable() 79 80 def base(self): 80 81 return cherrypy.request.base 82 base = tools.base_url.enable()(base) 81 83 base.exposed = True 82 84 … … 118 120 119 121 # METHOD TWO: decorator using Tool.wrap 122 # We support Python 2.3, but the @-deco syntax would look like this: 123 # @tools.check_access.wrap() 120 124 def restricted(self): 121 125 return "Welcome!"

