Author: chrisz
Date: Sat Jan 26 06:51:02 2008
New Revision: 4052
URL: http://trac.turbogears.org/changeset/4052

Log:
Merged additional controller tests from 1.0 to 1.1 branch.

Modified:
   branches/1.1/turbogears/identity/tests/test_identity.py
   branches/1.1/turbogears/tests/test_controllers.py

Modified: branches/1.1/turbogears/identity/tests/test_identity.py
==============================================================================
--- branches/1.1/turbogears/identity/tests/test_identity.py     (original)
+++ branches/1.1/turbogears/identity/tests/test_identity.py     Sat Jan 26 
06:51:02 2008
@@ -440,6 +440,23 @@
         firstline = cherrypy.response.body[0]
         assert 'identity_failed' in firstline, firstline
 
+    def test_decode_filter_whenidfails(self):
+        """Test that the decode filter doesn't break with nested
+        variables and Identity"""
+        params = 
urllib.quote(IdentityRoot._test_encoded_params.decode('utf-8').encode('latin-1'),
 '=&')
+        testutil.create_request('/test_params?' + params)
+        firstline = cherrypy.response.body[0]
+        assert 'identity_failed_answer' in firstline, firstline
+
+    def test_decode_filter_whenidworks(self):
+        """Test that the decode filter doesn't break with nested
+        variables and Identity"""
+        params = 
urllib.quote(IdentityRoot._test_encoded_params.decode('utf-8').encode('latin-1'),
 '=&')
+        params += '&user_name=samIam&password=secret&login=Login'
+        testutil.create_request('/test_params?' + params)
+        firstline = cherrypy.response.body[0]
+        assert 'params ok' in firstline, firstline
+
 
 class TestTGUser(testutil.DBTest):
     model = TG_User

Modified: branches/1.1/turbogears/tests/test_controllers.py
==============================================================================
--- branches/1.1/turbogears/tests/test_controllers.py   (original)
+++ branches/1.1/turbogears/tests/test_controllers.py   Sat Jan 26 06:51:02 2008
@@ -482,6 +482,25 @@
         assert not cherrypy.root.serve_exceptions
         #assert "AssertionError" not in outputcap.getvalue()
 
+    def test_internal_redirect(self):
+        '''
+        test to make sure we don't have regressions on tickets: #1598, #1407
+        and #1022
+        '''
+        testutil.createRequest("/internal_redirect")
+        firstline = cherrypy.response.body[0]
+        assert "redirected OK" in firstline
+
+    def test_internal_redirect_nested_variables(self):
+        '''
+        test to make sure we don't have regressions on tickets: #1598, #1407
+        and #1022
+        '''
+        
testutil.createRequest("/internal_redirect?a=1&a-1.b=2&a-2.c=3&a-2.c-1=4")
+        firstline = cherrypy.response.body[0]
+        print firstline
+        assert "redirected OK" in firstline
+
     def test_exc_value(self):
         '''
         our exception raised in the controller should be handled

Reply via email to