cubicweb/pyramid/test/test_login.py
changeset 11929 fcbd6b251d81
parent 11924 4c949c28ce59
child 12088 477a59a45786
equal deleted inserted replaced
11920:f13799fbcfea 11929:fcbd6b251d81
     2 from shutil import rmtree
     2 from shutil import rmtree
     3 
     3 
     4 from cubicweb.pyramid.test import PyramidCWTest
     4 from cubicweb.pyramid.test import PyramidCWTest
     5 
     5 
     6 
     6 
       
     7 class LoginTestLangUrlPrefix(PyramidCWTest):
       
     8 
       
     9     @classmethod
       
    10     def setUpClass(cls):
       
    11         super(LoginTestLangUrlPrefix, cls).setUpClass()
       
    12         cls.config.global_set_option('language-mode', 'url-prefix')
       
    13 
       
    14     def test_login_password_login_lang_prefix(self):
       
    15         res = self.webapp.post('/fr/login', {
       
    16             '__login': self.admlogin, '__password': self.admpassword})
       
    17         self.assertEqual(res.status_int, 303)
       
    18 
       
    19         res = self.webapp.get('/fr/login')
       
    20         self.assertEqual(res.status_int, 303)
       
    21 
       
    22 
     7 class LoginTest(PyramidCWTest):
    23 class LoginTest(PyramidCWTest):
       
    24 
     8     def test_login_form(self):
    25     def test_login_form(self):
     9         res = self.webapp.get('/login')
    26         res = self.webapp.get('/login')
    10         self.assertIn('__login', res.text)
    27         self.assertIn('__login', res.text)
    11 
    28 
    12     def test_login_password_login(self):
    29     def test_login_password_login(self):