# HG changeset patch # User Alexandre Fayolle # Date 1301661496 -7200 # Node ID b817d44cb606ff68e75865c8ddab74f55f69bc1b # Parent 93a19c1831aac2e1eab183bb85717565c3c5119c# Parent d6d905d0344fc4a116886fd8cd96aa7d176f2cf2 merged test fix from stable diff -r 93a19c1831aa -r b817d44cb606 devtools/testlib.py --- a/devtools/testlib.py Fri Apr 01 14:34:11 2011 +0200 +++ b/devtools/testlib.py Fri Apr 01 14:38:16 2011 +0200 @@ -662,13 +662,16 @@ """ return self.expect_redirect(lambda x: self.app_publish(x, path), req) - def init_authentication(self, authmode, anonuser=None): + def set_auth_mode(self, authmode, anonuser=None): self.set_option('auth-mode', authmode) self.set_option('anonymous-user', anonuser) if anonuser is None: self.config.anonymous_credential = None else: self.config.anonymous_credential = (anonuser, anonuser) + + def init_authentication(self, authmode, anonuser=None): + self.set_auth_mode(authmode, anonuser) req = self.request() origsession = req.session req.session = req.cnx = None diff -r 93a19c1831aa -r b817d44cb606 web/test/unittest_application.py --- a/web/test/unittest_application.py Fri Apr 01 14:34:11 2011 +0200 +++ b/web/test/unittest_application.py Fri Apr 01 14:38:16 2011 +0200 @@ -315,8 +315,7 @@ def test_fb_login_concept(self): """see data/views.py""" - self.set_option('auth-mode', 'cookie') - self.set_option('anonymous-user', 'anon') + self.set_auth_mode('cookie', 'anon') self.login('anon') req = self.request() origcnx = req.cnx @@ -325,6 +324,7 @@ self.failIf(req.cnx is origcnx) self.assertEqual(req.user.login, 'turlututu') self.failUnless('turlututu' in page, page) + req.cnx.close() # avoid warning # authentication tests ####################################################