cubicweb/pyramid/test/test_login.py
branch3.24
changeset 11924 4c949c28ce59
parent 11816 6392f34fcdad
child 11929 fcbd6b251d81
--- a/cubicweb/pyramid/test/test_login.py	Fri Nov 18 10:28:41 2016 +0100
+++ b/cubicweb/pyramid/test/test_login.py	Fri Jan 13 11:36:51 2017 +0100
@@ -3,8 +3,25 @@
 
 from cubicweb.pyramid.test import PyramidCWTest
 
+class LoginTestLangUrlPrefix(PyramidCWTest):
+
+    @classmethod
+    def setUpClass(cls):
+        super(LoginTestLangUrlPrefix, cls).setUpClass()
+        cls.config.global_set_option('language-mode', 'url-prefix')
+
+    def test_login_password_login_lang_prefix(self):
+        res = self.webapp.post('/fr/login', {
+            '__login': self.admlogin, '__password': self.admpassword})
+        self.assertEqual(res.status_int, 303)
+
+        res = self.webapp.get('/fr/login')
+        self.assertEqual(res.status_int, 303)
+
+
 
 class LoginTest(PyramidCWTest):
+
     def test_login_form(self):
         res = self.webapp.get('/login')
         self.assertIn('__login', res.text)