summaryrefslogtreecommitdiff
path: root/tests/i18n
diff options
context:
space:
mode:
Diffstat (limited to 'tests/i18n')
-rw-r--r--tests/i18n/__init__.py18
-rw-r--r--tests/i18n/contenttypes/tests.py4
-rw-r--r--tests/i18n/tests.py3
3 files changed, 2 insertions, 23 deletions
diff --git a/tests/i18n/__init__.py b/tests/i18n/__init__.py
index c5aaa31fe3..e69de29bb2 100644
--- a/tests/i18n/__init__.py
+++ b/tests/i18n/__init__.py
@@ -1,18 +0,0 @@
-from threading import local
-
-
-class TransRealMixin(object):
- """This is the only way to reset the translation machinery. Otherwise
- the test suite occasionally fails because of global state pollution
- between tests."""
- def flush_caches(self):
- from django.utils.translation import trans_real
- trans_real._translations = {}
- trans_real._active = local()
- trans_real._default = None
- trans_real._accepted = {}
- trans_real._checked_languages = {}
-
- def tearDown(self):
- self.flush_caches()
- super(TransRealMixin, self).tearDown()
diff --git a/tests/i18n/contenttypes/tests.py b/tests/i18n/contenttypes/tests.py
index cbac9ec5da..c48f8fc6dd 100644
--- a/tests/i18n/contenttypes/tests.py
+++ b/tests/i18n/contenttypes/tests.py
@@ -5,13 +5,11 @@ import os
from django.contrib.contenttypes.models import ContentType
from django.test import TestCase
-from django.test.utils import override_settings
+from django.test.utils import override_settings, TransRealMixin
from django.utils._os import upath
from django.utils import six
from django.utils import translation
-from i18n import TransRealMixin
-
@override_settings(
USE_I18N=True,
diff --git a/tests/i18n/tests.py b/tests/i18n/tests.py
index ae9d9f1970..4be0fbf2ac 100644
--- a/tests/i18n/tests.py
+++ b/tests/i18n/tests.py
@@ -12,7 +12,7 @@ from django.core.management.utils import find_command
from django.template import Template, Context
from django.template.base import TemplateSyntaxError
from django.test import TestCase, RequestFactory
-from django.test.utils import override_settings
+from django.test.utils import override_settings, TransRealMixin
from django.utils import translation
from django.utils.formats import (get_format, date_format, time_format,
localize, localize_input, iter_format_modules, get_format_modules,
@@ -44,7 +44,6 @@ if find_command('msgfmt'):
from .commands.compilation import (PoFileTests, PoFileContentsTests,
PercentRenderingTests, MultipleLocaleCompilationTests,
CompilationErrorHandling)
-from . import TransRealMixin
from .forms import I18nForm, SelectDateForm, SelectDateWidget, CompanyForm
from .models import Company, TestModel