# HG changeset patch # User Sylvain Thénault # Date 1268757872 -3600 # Node ID 4b8cdda342aeaedaca2292a1d454fcd376adf4e8 # Parent 898c35be58731f75c72663d65e486121d0a4284d fix tests diff -r 898c35be5873 -r 4b8cdda342ae devtools/testlib.py --- a/devtools/testlib.py Tue Mar 16 12:40:59 2010 +0100 +++ b/devtools/testlib.py Tue Mar 16 17:44:32 2010 +0100 @@ -503,7 +503,7 @@ req.cnx = None sh = self.app.session_handler authm = sh.session_manager.authmanager - authm.authinforetreivers[-1].anoninfo = self.vreg.config.anonymous_user() + authm.anoninfo = self.vreg.config.anonymous_user() # not properly cleaned between tests self.open_sessions = sh.session_manager._sessions = {} return req, origcnx diff -r 898c35be5873 -r 4b8cdda342ae web/test/unittest_views_pyviews.py --- a/web/test/unittest_views_pyviews.py Tue Mar 16 12:40:59 2010 +0100 +++ b/web/test/unittest_views_pyviews.py Tue Mar 16 17:44:32 2010 +0100 @@ -9,10 +9,10 @@ content = view.render(pyvalue=[[1, 'a'], [2, 'b']], headers=['num', 'char']) self.assertEquals(content.strip(), ''' - - + + -
numchar
1a
numchar
1a
2b
''') +''') def test_pyvallist(self): view = self.vreg['views'].select('pyvallist', self.request(), diff -r 898c35be5873 -r 4b8cdda342ae web/test/unittest_viewselector.py --- a/web/test/unittest_viewselector.py Tue Mar 16 12:40:59 2010 +0100 +++ b/web/test/unittest_viewselector.py Tue Mar 16 17:44:32 2010 +0100 @@ -67,6 +67,7 @@ req = self.request() self.assertListEqual(self.pviews(req, None), [('changelog', wdoc.ChangeLogView), + ('gc', debug.GCView), ('index', startup.IndexView), ('info', debug.ProcessInformationView), ('manage', startup.ManageView), diff -r 898c35be5873 -r 4b8cdda342ae web/views/authentication.py --- a/web/views/authentication.py Tue Mar 16 12:40:59 2010 +0100 +++ b/web/views/authentication.py Tue Mar 16 17:44:32 2010 +0100 @@ -140,13 +140,13 @@ # restore an anonymous connection if possible login, password = self.anoninfo if login: - return self._authenticate(req, login, {'password': password}) + cnx = self._authenticate(req, login, {'password': password}) + cnx.anonymous_connection = True + return cnx raise ExplicitLogin() def _init_cnx(self, cnx, login, authinfo): # decorate connection - if login == self.vreg.config.anonymous_user()[0]: - cnx.anonymous_connection = True cnx.vreg = self.vreg cnx.login = login cnx.authinfo = authinfo diff -r 898c35be5873 -r 4b8cdda342ae web/views/debug.py --- a/web/views/debug.py Tue Mar 16 12:40:59 2010 +0100 +++ b/web/views/debug.py Tue Mar 16 17:44:32 2010 +0100 @@ -119,7 +119,7 @@ def call(self, **kwargs): self.w(u'

%s

' % _("Registry's content")) keys = sorted(self._cw.vreg) - url = self._cw.url() + url = xml_escape(self._cw.url()) self.w(u'

%s

\n' % ' - '.join('%s' % (url, key, key) for key in keys)) for key in keys: