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

Changeset 1529

Show
Ignore:
Timestamp:
12/14/06 12:26:07
Author:
dowski
Message:

Test that demonstrates that URL #fragments get passed back to the UA in the Location header and response body when appended to a URI in a HTTPRedirect using CP3.

Files:

Legend:

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

    r1528 r1529  
    146146        def stringify(self): 
    147147            return str(cherrypy.HTTPRedirect("/")) 
    148      
     148         
     149        def fragment(self, frag): 
     150            raise cherrypy.HTTPRedirect("/some/url#%s" % frag) 
    149151     
    150152    def login_redir(): 
     
    612614            self.assertStatus(200) 
    613615            self.assertBody("(['%s/'], 303)" % self.base()) 
     616         
     617        # check that #fragments are handled properly 
     618        # http://skrb.org/ietf/http_errata.html#location-fragments 
     619        frag = "foo" 
     620        self.getPage("/redirect/fragment/%s" % frag) 
     621        self.assertMatchesBody(r"<a href='(.*)\/some\/url\#%s'>\1\/some\/url\#%s</a>" % (frag, frag)) 
     622        self.assert_(dict(self.headers)['Location'].endswith("#%s" % frag)) 
     623        self.assertStatus(303) 
    614624     
    615625    def test_InternalRedirect(self): 

Hosted by WebFaction

Log in as guest/cpguest to create tickets