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
def tearDown(self): translation.activate(self._orig_lang)
def tearDown(self): trans_real._translations = self._translations activate(self._language)
def setUp(self): self._orig_lang = translation.get_language() translation.activate('en-us')
def setUp(self): self._language = get_language() self._translations = trans_real._translations activate('fr')