Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #17197 -- Prevented a locale leakage from an i18n test causing …

…collateral failures in the rest of the test suite. Thanks to Florian Apolloner for the report and patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17080 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 9d410ee64b1a0f2d8a714eeffa7e17e09965f01c 1 parent 64fdd84
Julien Phalip authored November 11, 2011
4  tests/regressiontests/views/tests/i18n.py
@@ -6,7 +6,7 @@
6 6
 
7 7
 from django.conf import settings
8 8
 from django.test import TestCase
9  
-from django.utils.translation import override, activate
  9
+from django.utils.translation import override, activate, get_language
10 10
 from django.utils.text import javascript_quote
11 11
 
12 12
 from ..urls import locale_dir
@@ -25,6 +25,7 @@ def test_setlang(self):
25 25
 
26 26
     def test_jsi18n(self):
27 27
         """The javascript_catalog can be deployed with language settings"""
  28
+        saved_lang = get_language()
28 29
         for lang_code in ['es', 'fr', 'ru']:
29 30
             activate(lang_code)
30 31
             catalog = gettext.translation('djangojs', locale_dir, [lang_code])
@@ -37,6 +38,7 @@ def test_jsi18n(self):
37 38
             if lang_code == 'fr':
38 39
                 # Message with context (msgctxt)
39 40
                 self.assertContains(response, "['month name\x04May'] = 'mai';", 1)
  41
+        activate(saved_lang)
40 42
 
41 43
 
42 44
 class JsI18NTests(TestCase):

0 notes on commit 9d410ee

Please sign in to comment.
Something went wrong with that request. Please try again.