Changeset 1597
- Timestamp:
- 01/12/07 06:53:55
- Files:
-
- trunk/cherrypy/_cpdispatch.py (modified) (1 diff)
- trunk/cherrypy/test/test_routes.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/_cpdispatch.py
r1470 r1597 301 301 if action is not None: 302 302 handler = getattr(controller, action) 303 303 # Get config from the handler 304 if hasattr(handler, "_cp_config"): 305 merge(handler._cp_config) 306 304 307 # Do the last path atom here so it can 305 308 # override the controller's _cp_config. trunk/cherrypy/test/test_routes.py
r1469 r1597 18 18 def index(self, **kwargs): 19 19 return "Welcome to %s, pop. %s" % (self.name, self.population) 20 index._cp_config = {'tools.response_headers.on': True, 21 'tools.response_headers.headers': [('Content-Language', 'en-GB')]} 20 22 21 23 def update(self, **kwargs): 22 24 self.population = kwargs['pop'] 23 25 return "OK" 24 26 25 27 d = cherrypy.dispatch.RoutesDispatcher() 26 28 d.connect(name='hounslow', route='hounslow', controller=City('Hounslow')) … … 53 55 self.getPage("/surbiton") 54 56 self.assertStatus("200 OK") 57 self.assertHeader("Content-Language", "en-GB") 55 58 self.assertBody("Welcome to Surbiton, pop. 1327") 56 57 59 58 60 if __name__ == '__main__':

