cubicweb/pyramid/test/test_login.py
branch3.24
changeset 11924 4c949c28ce59
parent 11816 6392f34fcdad
child 11929 fcbd6b251d81
equal deleted inserted replaced
11923:acfb9aa4845e 11924:4c949c28ce59
     1 from os.path import join
     1 from os.path import join
     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 class LoginTestLangUrlPrefix(PyramidCWTest):
       
     7 
       
     8     @classmethod
       
     9     def setUpClass(cls):
       
    10         super(LoginTestLangUrlPrefix, cls).setUpClass()
       
    11         cls.config.global_set_option('language-mode', 'url-prefix')
       
    12 
       
    13     def test_login_password_login_lang_prefix(self):
       
    14         res = self.webapp.post('/fr/login', {
       
    15             '__login': self.admlogin, '__password': self.admpassword})
       
    16         self.assertEqual(res.status_int, 303)
       
    17 
       
    18         res = self.webapp.get('/fr/login')
       
    19         self.assertEqual(res.status_int, 303)
       
    20 
       
    21 
     6 
    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):