web/test/unittest_application.py
changeset 9069 aff871b58ba0
parent 9065 b1cad8e4557f
child 9071 46885bfa4150
equal deleted inserted replaced
9068:86dcc29740e0 9069:aff871b58ba0
   291         self.execute('DELETE CWProperty X WHERE X pkey "ui.language"')
   291         self.execute('DELETE CWProperty X WHERE X pkey "ui.language"')
   292         self.assertEqual(vreg.property_value('ui.language'), 'de')
   292         self.assertEqual(vreg.property_value('ui.language'), 'de')
   293         self.commit()
   293         self.commit()
   294         self.assertEqual(vreg.property_value('ui.language'), 'en')
   294         self.assertEqual(vreg.property_value('ui.language'), 'en')
   295 
   295 
   296     def test_fb_login_concept(self):
       
   297         """see data/views.py"""
       
   298         self.set_auth_mode('cookie', 'anon')
       
   299         self.login('anon')
       
   300         req = self.request()
       
   301         origcnx = req.cnx
       
   302         req.form['__fblogin'] = u'turlututu'
       
   303         page = self.app.handle_request(req, '')
       
   304         self.assertFalse(req.cnx is origcnx)
       
   305         self.assertEqual(req.user.login, 'turlututu')
       
   306         self.assertTrue('turlututu' in page, page)
       
   307         req.cnx.close() # avoid warning
       
   308 
       
   309     # authentication tests ####################################################
   296     # authentication tests ####################################################
   310 
   297 
   311     def test_http_auth_no_anon(self):
   298     def test_http_auth_no_anon(self):
   312         req, origsession = self.init_authentication('http')
   299         req, origsession = self.init_authentication('http')
   313         self.assertAuthFailure(req)
   300         self.assertAuthFailure(req)