cubicweb/pyramid/test/test_login.py
changeset 11929 fcbd6b251d81
parent 11924 4c949c28ce59
child 12088 477a59a45786
--- a/cubicweb/pyramid/test/test_login.py	Mon Jan 23 15:35:19 2017 +0100
+++ b/cubicweb/pyramid/test/test_login.py	Fri Jan 27 16:26:09 2017 +0100
@@ -4,7 +4,24 @@
 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)