mock ``CWUser.prefered_language()`` on InternalManager objects.
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Fri, 21 Sep 2012 15:03:59 +0200
changeset 8563 d28ccecb7bf5
parent 8562 0d2fb4604265
child 8569 40b3634eebe8
mock ``CWUser.prefered_language()`` on InternalManager objects. The recent split of patches for session refactoring broke this.
server/session.py
--- a/server/session.py	Fri Sep 14 14:15:39 2012 +0200
+++ b/server/session.py	Fri Sep 21 15:03:59 2012 +0200
@@ -1213,6 +1213,9 @@
             return 'en'
         return None
 
+    def prefered_language(self, language=None):
+        # mock CWUser.prefered_language, mainly for testing purpose
+        return self.property_value('ui.language')
 
 from logging import getLogger
 from cubicweb import set_log_methods