Commits

shel...@shellegouarch-pc.rennes.envivio.com  committed 9720342

HTTP error messages have changed accross Python versions.

  • Participants
  • Parent commits af7483c
  • Branches cherrypy-3.1.x

Comments (0)

Files changed (1)

File cherrypy/test/test_session.py

         # skips the session code's before_handler and only calls
         # before_finalize (save) and on_end (close). So the session
         # code has to survive calling save/close without init.
-        self.getPage('/restricted', self.cookies, method='POST')
-        self.assertErrorPage(405, "Specified method is invalid for this resource.")
+        self.getPage('/restricted', self.cookies, method='POST')        
+        if sys.version_info <= (2, 6):
+            self.assertErrorPage(405, "Specified method is invalid for this server.")
+        else:
+            self.assertErrorPage(405, "Specified method is invalid for this resource.")
     
     def test_6_regenerate(self):
         self.getPage('/testStr')
             # before_finalize (save) and on_end (close). So the session
             # code has to survive calling save/close without init.
             self.getPage('/restricted', self.cookies, method='POST')
-            self.assertErrorPage(405, "Specified method is invalid for this resource.")
+            if sys.version_info <= (2, 6):
+                self.assertErrorPage(405, "Specified method is invalid for this server.")
+            else:
+                self.assertErrorPage(405, "Specified method is invalid for this resource.")