diff options
| author | Alex Gaynor <alex.gaynor@gmail.com> | 2011-01-17 09:52:47 +0000 |
|---|---|---|
| committer | Alex Gaynor <alex.gaynor@gmail.com> | 2011-01-17 09:52:47 +0000 |
| commit | fcbf881d8200f3771dd07be63e94171dd9548b92 (patch) | |
| tree | 4284a2e33932748c686ff655b3185ae4a0ddf710 /tests | |
| parent | 964cf1be866e7db410d8a5b08d4d83c620a697cd (diff) | |
Refactor all uses of thread locals to be more consistant and sane.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15232 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/regressiontests/i18n/tests.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/regressiontests/i18n/tests.py b/tests/regressiontests/i18n/tests.py index 98c0ed9aaa..deba5d1d03 100644 --- a/tests/regressiontests/i18n/tests.py +++ b/tests/regressiontests/i18n/tests.py @@ -4,10 +4,12 @@ import decimal import os import sys import pickle +from threading import local from django.conf import settings from django.template import Template, Context -from django.utils.formats import get_format, date_format, time_format, localize, localize_input, iter_format_modules +from django.utils.formats import (get_format, date_format, time_format, + localize, localize_input, iter_format_modules) from django.utils.importlib import import_module from django.utils.numberformat import format as nformat from django.utils.safestring import mark_safe, SafeString, SafeUnicode @@ -61,7 +63,7 @@ class TranslationTests(TestCase): self.old_locale_paths = settings.LOCALE_PATHS settings.LOCALE_PATHS += (os.path.join(os.path.dirname(os.path.abspath(__file__)), 'other', 'locale'),) from django.utils.translation import trans_real - trans_real._active = {} + trans_real._active = local() trans_real._translations = {} activate('de') @@ -649,7 +651,7 @@ class ResolutionOrderI18NTests(TestCase): from django.utils.translation import trans_real # Okay, this is brutal, but we have no other choice to fully reset # the translation framework - trans_real._active = {} + trans_real._active = local() trans_real._translations = {} activate('de') |
