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

Changeset 1461

Show
Ignore:
Timestamp:
12/01/06 23:33:01
Author:
fumanchu
Message:

Test case for #613 (HTTPRedirect from default handler goes up one directory).

Files:

Legend:

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

    r1413 r1461  
    104104    class DefNoIndex: 
    105105        def default(self, *args): 
    106             return "defnoindex:" + repr(args
     106            raise cherrypy.HTTPRedirect("contact"
    107107        default.exposed = True 
    108108     
     
    196196             
    197197            # Test *vpath when default() is defined but not index() 
     198            # This also tests HTTPRedirect with default. 
    198199            self.getPage("/defnoindex") 
    199             self.assertBody("defnoindex:()") 
     200            self.assertStatus((302, 303)) 
     201            self.assertHeader('Location', '%s/contact' % self.base()) 
    200202            self.getPage("/defnoindex/") 
    201             self.assertBody("defnoindex:()") 
     203            self.assertStatus((302, 303)) 
     204            self.assertHeader('Location', '%s/defnoindex/contact' % self.base()) 
     205            self.getPage("/defnoindex/page") 
     206            self.assertStatus((302, 303)) 
     207            self.assertHeader('Location', '%s/defnoindex/contact' % self.base()) 
    202208             
    203209            self.getPage("/redirect") 

Hosted by WebFaction

Log in as guest/cpguest to create tickets