web/test/unittest_application.py
changeset 9019 e08f9c55dab5
parent 9017 aa709bc6b6c1
child 9039 488255d1cf3b
equal deleted inserted replaced
9018:9deb024a96c0 9019:e08f9c55dab5
   376         clear_cache(req, 'get_authorization')
   376         clear_cache(req, 'get_authorization')
   377         # reset session as if it was a new incoming request
   377         # reset session as if it was a new incoming request
   378         req.session = req.cnx = None
   378         req.session = req.cnx = None
   379 
   379 
   380     def _test_auth_anon(self, req):
   380     def _test_auth_anon(self, req):
   381         self.app.connect(req)
   381         asession = self.app.get_session(req)
   382         asession = req.session
   382         req.set_session(asession)
   383         self.assertEqual(len(self.open_sessions), 1)
   383         self.assertEqual(len(self.open_sessions), 1)
   384         self.assertEqual(asession.login, 'anon')
   384         self.assertEqual(asession.login, 'anon')
   385         self.assertTrue(asession.anonymous_session)
   385         self.assertTrue(asession.anonymous_session)
   386         self._reset_cookie(req)
   386         self._reset_cookie(req)
   387 
   387 
   388     def _test_anon_auth_fail(self, req):
   388     def _test_anon_auth_fail(self, req):
   389         self.assertEqual(len(self.open_sessions), 1)
   389         self.assertEqual(len(self.open_sessions), 1)
   390         self.app.connect(req)
   390         session = self.app.get_session(req)
       
   391         req.set_session(session)
   391         self.assertEqual(req.message, 'authentication failure')
   392         self.assertEqual(req.message, 'authentication failure')
   392         self.assertEqual(req.session.anonymous_session, True)
   393         self.assertEqual(req.session.anonymous_session, True)
   393         self.assertEqual(len(self.open_sessions), 1)
   394         self.assertEqual(len(self.open_sessions), 1)
   394         self._reset_cookie(req)
   395         self._reset_cookie(req)
   395 
   396