# HG changeset patch # User Sylvain Thénault # Date 1280327483 -7200 # Node ID 52f9a43d8e084ea5148e8ce0ef09b6f582dee21b # Parent a1544ca8913ec73a127ed9d55dccbb0b47da681e [session] session auto reconnect feature has gone with the session-time refactoring in 6012:d56fd78006cd diff -r a1544ca8913e -r 52f9a43d8e08 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