web/test/unittest_application.py
changeset 9065 b1cad8e4557f
parent 9064 2e64254548ca
child 9069 aff871b58ba0
--- a/web/test/unittest_application.py	Mon Jun 24 18:23:48 2013 +0200
+++ b/web/test/unittest_application.py	Mon Jun 24 18:35:22 2013 +0200
@@ -30,6 +30,7 @@
 from cubicweb.web import LogOut, Redirect, INTERNAL_FIELD_VALUE
 from cubicweb.web.views.basecontrollers import ViewController
 from cubicweb.web.application import anonymized_request
+from cubicweb.dbapi import DBAPISession, _NeedAuthAccessMock
 
 class FakeMapping:
     """emulates a mapping module"""
@@ -366,7 +367,9 @@
                                raw=True)
         clear_cache(req, 'get_authorization')
         # reset session as if it was a new incoming request
-        req.session = req.cnx = None
+        req.session = DBAPISession(None)
+        req.user = req.cnx = _NeedAuthAccessMock
+        
 
     def _test_auth_anon(self, req):
         asession = self.app.get_session(req)