[test] Fix language negotiation test 3.24
authorFlorent Cayré <florent.cayre@gmail.com>
Tue, 15 Nov 2016 00:12:34 +0100
branch3.24
changeset 11828 a06cf11f7d87
parent 11827 851b6bd79b50
child 11829 17078e20088f
[test] Fix language negotiation test At least when executed alone (there seems to be a test isolation problem which I could not figure out).
cubicweb/web/test/unittest_application.py
--- a/cubicweb/web/test/unittest_application.py	Thu Nov 10 18:25:50 2016 +0100
+++ b/cubicweb/web/test/unittest_application.py	Tue Nov 15 00:12:34 2016 +0100
@@ -248,8 +248,9 @@
         """Language negociated, normal case."""
         self.config.global_set_option('language-mode', 'http-negotiation')
         orig_translations = self.config.translations.copy()
-        self.config.translations = {'fr': (text_type, text_type),
-                                    'en': (text_type, text_type)}
+        self.config.translations = {
+            'fr': (text_type, lambda x, y: text_type(y)),
+            'en': (text_type, lambda x, y: text_type(y))}
         try:
             headers = {'Accept-Language': 'fr'}
             with self.admin_access.web_request(headers=headers) as req: