Example #1
0
 def wrapped(*args, **kwargs):
     from djmodels.utils import translation
     saved_locale = translation.get_language()
     translation.deactivate_all()
     try:
         res = handle_func(*args, **kwargs)
     finally:
         if saved_locale is not None:
             translation.activate(saved_locale)
     return res
Example #2
0
 def tearDown(self):
     translation.activate(self._orig_lang)
Example #3
0
 def tearDown(self):
     trans_real._translations = self._translations
     activate(self._language)
Example #4
0
 def setUp(self):
     self._orig_lang = translation.get_language()
     translation.activate('en-us')
Example #5
0
 def setUp(self):
     self._language = get_language()
     self._translations = trans_real._translations
     activate('fr')