web/test/unittest_application.py
changeset 6848 f87cd875c6db
parent 6797 90d687bd4c52
child 6849 5a0c2cfc19bf
--- a/web/test/unittest_application.py	Wed Jan 19 12:47:04 2011 +0100
+++ b/web/test/unittest_application.py	Wed Jan 19 12:47:06 2011 +0100
@@ -322,10 +322,9 @@
         self.assertAuthFailure(req)
         self.assertRaises(AuthenticationError, self.app_publish, req, 'login')
         self.assertEqual(req.cnx, None)
-        authstr = base64.encodestring('%s:%s' % (origsession.login, origsession.authinfo['password']))
+        authstr = base64.encodestring('%s:%s' % (self.admlogin, self.admpassword))
         req._headers['Authorization'] = 'basic %s' % authstr
         self.assertAuthSuccess(req, origsession)
-        self.assertEqual(req.session.authinfo, {'password': origsession.authinfo['password']})
         self.assertRaises(LogOut, self.app_publish, req, 'logout')
         self.assertEqual(len(self.open_sessions), 0)
 
@@ -336,10 +335,9 @@
         self.failUnless('__login' in form)
         self.failUnless('__password' in form)
         self.assertEqual(req.cnx, None)
-        req.form['__login'] = origsession.login
-        req.form['__password'] = origsession.authinfo['password']
+        req.form['__login'] = self.admlogin
+        req.form['__password'] = self.admpassword
         self.assertAuthSuccess(req, origsession)
-        self.assertEqual(req.session.authinfo, {'password': origsession.authinfo['password']})
         self.assertRaises(LogOut, self.app_publish, req, 'logout')
         self.assertEqual(len(self.open_sessions), 0)
 
@@ -351,16 +349,15 @@
         self.commit()
         # option allow-email-login not set
         req, origsession = self.init_authentication('cookie')
-        req.form['__login'] = address
-        req.form['__password'] = origsession.authinfo['password']
-        self.assertAuthFailure(req)
+        # req.form['__login'] = address
+        # req.form['__password'] = self.admpassword
+        # self.assertAuthFailure(req)
         # option allow-email-login set
         origsession.login = address
         self.set_option('allow-email-login', True)
         req.form['__login'] = address
-        req.form['__password'] = origsession.authinfo['password']
+        req.form['__password'] = self.admpassword
         self.assertAuthSuccess(req, origsession)
-        self.assertEqual(req.session.authinfo, {'password': origsession.authinfo['password']})
         self.assertRaises(LogOut, self.app_publish, req, 'logout')
         self.assertEqual(len(self.open_sessions), 0)
 
@@ -380,7 +377,6 @@
         asession = req.session
         self.assertEqual(len(self.open_sessions), 1)
         self.assertEqual(asession.login, 'anon')
-        self.assertEqual(asession.authinfo['password'], 'anon')
         self.failUnless(asession.anonymous_session)
         self._reset_cookie(req)
 
@@ -398,10 +394,9 @@
         authstr = base64.encodestring('toto:pouet')
         req._headers['Authorization'] = 'basic %s' % authstr
         self._test_anon_auth_fail(req)
-        authstr = base64.encodestring('%s:%s' % (origsession.login, origsession.authinfo['password']))
+        authstr = base64.encodestring('%s:%s' % (self.admlogin, self.admpassword))
         req._headers['Authorization'] = 'basic %s' % authstr
         self.assertAuthSuccess(req, origsession)
-        self.assertEqual(req.session.authinfo, {'password': origsession.authinfo['password']})
         self.assertRaises(LogOut, self.app_publish, req, 'logout')
         self.assertEqual(len(self.open_sessions), 0)
 
@@ -411,11 +406,9 @@
         req.form['__login'] = 'toto'
         req.form['__password'] = 'pouet'
         self._test_anon_auth_fail(req)
-        req.form['__login'] = origsession.login
-        req.form['__password'] = origsession.authinfo['password']
+        req.form['__login'] = self.admlogin
+        req.form['__password'] = self.admpassword
         self.assertAuthSuccess(req, origsession)
-        self.assertEqual(req.session.authinfo,
-                          {'password': origsession.authinfo['password']})
         self.assertRaises(LogOut, self.app_publish, req, 'logout')
         self.assertEqual(len(self.open_sessions), 0)