Ticket #17197: fix_testsuite_translation_leakage3.diff

File fix_testsuite_translation_leakage3.diff, 1.1 KB (added by apollo13, 3 years ago)
  • tests/regressiontests/views/tests/i18n.py

    diff --git a/tests/regressiontests/views/tests/i18n.py b/tests/regressiontests/views/tests/i18n.py
    index 2f67d52..877cf96 100644
    a b from os import path 
    66
    77from django.conf import settings
    88from django.test import TestCase
    9 from django.utils.translation import override, activate
     9from django.utils.translation import override, activate, get_language
    1010from django.utils.text import javascript_quote
    1111
    1212from ..urls import locale_dir
    class I18NTests(TestCase): 
    2525
    2626    def test_jsi18n(self):
    2727        """The javascript_catalog can be deployed with language settings"""
     28        saved_lang = get_language()
    2829        for lang_code in ['es', 'fr', 'ru']:
    2930            activate(lang_code)
    3031            catalog = gettext.translation('djangojs', locale_dir, [lang_code])
    class I18NTests(TestCase): 
    3738            if lang_code == 'fr':
    3839                # Message with context (msgctxt)
    3940                self.assertContains(response, "['month name\x04May'] = 'mai';", 1)
     41        activate(saved_lang)
    4042
    4143
    4244class JsI18NTests(TestCase):
Back to Top