[Zope-CVS] CVS: Products/CookieCrumbler/tests - testCookieCrumbler.py:1.2

Shane Hathaway shane@zope.com
Tue, 10 Jun 2003 13:44:47 -0400


Update of /cvs-repository/Products/CookieCrumbler/tests
In directory cvs.zope.org:/tmp/cvs-serv17489/tests

Modified Files:
	testCookieCrumbler.py 
Log Message:
Login redirection now restores the query string.

=== Products/CookieCrumbler/tests/testCookieCrumbler.py 1.1 => 1.2 ===
--- Products/CookieCrumbler/tests/testCookieCrumbler.py:1.1	Fri Jun  6 16:40:44 2003
+++ Products/CookieCrumbler/tests/testCookieCrumbler.py	Tue Jun 10 13:44:46 2003
@@ -177,6 +177,19 @@
             self.fail('Did not redirect')
 
 
+    def testLoginRestoresQueryString(self):
+        # When redirecting for login, the came_from form field should
+        # include the submitted URL as well as the query string.
+        self.req['QUERY_STRING'] = 'a:int=1&x:string=y'
+        try:
+            self.req.traverse('/protected')
+        except 'Redirect', s:
+            to_find = urllib.quote('/protected?' + self.req['QUERY_STRING'])
+            self.assert_(s.find(to_find) >= 0, s)
+        else:
+            self.fail('Did not redirect')
+
+
     def testCacheHeaderAnonymous(self):
         # Should not set cache-control
         self.req.traverse('/')