Ticket #17197: fix_testsuite_translation_leakage2.diff

File fix_testsuite_translation_leakage2.diff, 1.2 KB (added by Florian Apolloner, 13 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..9f22963 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        if saved_lang is not None:
     42            activate(saved_lang)
    4043
    4144
    4245class JsI18NTests(TestCase):
Back to Top