diff --git a/django/contrib/humanize/tests.py b/django/contrib/humanize/tests.py
index ab4d53c760..4a58a64889 100644
--- a/django/contrib/humanize/tests.py
+++ b/django/contrib/humanize/tests.py
@@ -12,7 +12,6 @@ from django.conf import settings
from django.contrib.humanize.templatetags import humanize
from django.template import Template, Context, defaultfilters
from django.test import TestCase, override_settings
-from django.test.utils import TransRealMixin
from django.utils.html import escape
from django.utils.timezone import utc, get_fixed_timezone
from django.utils import translation
@@ -36,7 +35,7 @@ class MockDateTime(datetime.datetime):
return now.replace(tzinfo=tz) + tz.utcoffset(now)
-class HumanizeTests(TransRealMixin, TestCase):
+class HumanizeTests(TestCase):
def humanize_tester(self, test_list, result_list, method, normalize_result_func=escape):
for test_content, result in zip(test_list, result_list):
diff --git a/tests/defaultfilters/tests.py b/tests/defaultfilters/tests.py
index 2dc6d9cf0c..6e309dc97a 100644
--- a/tests/defaultfilters/tests.py
+++ b/tests/defaultfilters/tests.py
@@ -17,7 +17,6 @@ from django.template.defaultfilters import (
urlize, urlizetrunc, wordcount, wordwrap, yesno,
)
from django.test import TestCase
-from django.test.utils import TransRealMixin
from django.utils import six
from django.utils import translation
from django.utils.safestring import SafeData
@@ -683,11 +682,11 @@ class DefaultFiltersTests(TestCase):
self.assertEqual(striptags(123), '123')
-class DefaultFiltersI18NTests(TransRealMixin, TestCase):
+class DefaultFiltersI18NTests(TestCase):
def test_localized_filesizeformat(self):
# NOTE: \xa0 avoids wrapping between value and unit
- with self.settings(USE_L10N=True), translation.override('de', deactivate=True):
+ with self.settings(USE_L10N=True), translation.override('de'):
self.assertEqual(filesizeformat(1023), '1023\xa0Bytes')
self.assertEqual(filesizeformat(1024), '1,0\xa0KB')
self.assertEqual(filesizeformat(10 * 1024), '10,0\xa0KB')
diff --git a/tests/forms_tests/tests/test_regressions.py b/tests/forms_tests/tests/test_regressions.py
index 39459aa472..b009e800e1 100644
--- a/tests/forms_tests/tests/test_regressions.py
+++ b/tests/forms_tests/tests/test_regressions.py
@@ -9,13 +9,13 @@ from django.forms import (
TextInput,
)
from django.test import TestCase
-from django.utils.translation import ugettext_lazy, override
+from django.utils import translation
+from django.utils.translation import gettext_lazy, ugettext_lazy
from forms_tests.models import Cheese
-from django.test.utils import TransRealMixin
-class FormsRegressionsTestCase(TransRealMixin, TestCase):
+class FormsRegressionsTestCase(TestCase):
def test_class(self):
# Tests to prevent against recurrences of earlier bugs.
extra_attrs = {'class': 'special'}
@@ -37,9 +37,9 @@ class FormsRegressionsTestCase(TransRealMixin, TestCase):
self.assertHTMLEqual(f.as_p(), '
')
# Translations are done at rendering time, so multi-lingual apps can define forms)
- with override('de'):
+ with translation.override('de'):
self.assertHTMLEqual(f.as_p(), '
')
- with override('pl', deactivate=True):
+ with translation.override('pl'):
self.assertHTMLEqual(f.as_p(), '
')
def test_regression_5216(self):
@@ -73,13 +73,11 @@ class FormsRegressionsTestCase(TransRealMixin, TestCase):
self.assertEqual(f.clean(b'\xd1\x88\xd1\x82.'), '\u0448\u0442.')
# Translated error messages used to be buggy.
- with override('ru'):
+ with translation.override('ru'):
f = SomeForm({})
self.assertHTMLEqual(f.as_p(), '