Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 1597

Show
Ignore:
Timestamp:
01/12/07 06:53:55
Author:
lawouach
Message:

Fixed #641

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/_cpdispatch.py

    r1470 r1597  
    301301            if action is not None: 
    302302                handler = getattr(controller, action) 
    303          
     303                # Get config from the handler  
     304                if hasattr(handler, "_cp_config"):  
     305                    merge(handler._cp_config) 
     306                     
    304307        # Do the last path atom here so it can 
    305308        # override the controller's _cp_config. 
  • trunk/cherrypy/test/test_routes.py

    r1469 r1597  
    1818        def index(self, **kwargs): 
    1919            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')]} 
    2022         
    2123        def update(self, **kwargs): 
    2224            self.population = kwargs['pop'] 
    2325            return "OK" 
    24      
     26         
    2527    d = cherrypy.dispatch.RoutesDispatcher() 
    2628    d.connect(name='hounslow', route='hounslow', controller=City('Hounslow')) 
     
    5355        self.getPage("/surbiton") 
    5456        self.assertStatus("200 OK") 
     57        self.assertHeader("Content-Language", "en-GB") 
    5558        self.assertBody("Welcome to Surbiton, pop. 1327") 
    56  
    5759 
    5860if __name__ == '__main__': 

Hosted by WebFaction

Log in as guest/cpguest to create tickets