[session] session auto reconnect feature has gone with the session-time refactoring in 6012:d56fd78006cd
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 28 Jul 2010 16:31:23 +0200
changeset 6032 52f9a43d8e08
parent 6030 a1544ca8913e
child 6033 09db6f4619c9
[session] session auto reconnect feature has gone with the session-time refactoring in 6012:d56fd78006cd
web/test/unittest_session.py
--- a/web/test/unittest_session.py	Wed Jul 28 15:01:48 2010 +0200
+++ b/web/test/unittest_session.py	Wed Jul 28 16:31:23 2010 +0200
@@ -7,10 +7,11 @@
 :license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses
 """
 from cubicweb.devtools.testlib import CubicWebTC
+from cubicweb.web import InvalidSession
 
 class SessionTC(CubicWebTC):
 
-    def test_auto_reconnection(self):
+    def test_session_expiration(self):
         sm = self.app.session_handler.session_manager
         # make is if the web session has been opened by the session manager
         sm._sessions[self.cnx.sessionid] = self.websession
@@ -23,11 +24,8 @@
             # fake an incoming http query with sessionid in session cookie
             # don't use self.request() which try to call req.set_session
             req = self.requestcls(self.vreg)
-            websession = sm.get_session(req, sessionid)
-            self.assertEquals(len(sm._sessions), 1)
-            self.assertIs(websession, self.websession)
-            self.assertEquals(websession.sessionid, sessionid)
-            self.assertNotEquals(websession.sessionid, websession.cnx.sessionid)
+            self.assertRaises(InvalidSession, sm.get_session, req, sessionid)
+            self.assertEquals(len(sm._sessions), 0)
         finally:
             # avoid error in tearDown by telling this connection is closed...
             self.cnx._closed = True