diff --git a/django/test/testcases.py b/django/test/testcases.py index 58f1f200323..a9a432fa210 100644 --- a/django/test/testcases.py +++ b/django/test/testcases.py @@ -34,7 +34,6 @@ from django.test.utils import ( override_settings, ) from django.utils.decorators import classproperty -from django.utils.encoding import force_text from django.views.static import serve __all__ = ('TestCase', 'TransactionTestCase', @@ -339,7 +338,7 @@ class SimpleTestCase(unittest.TestCase): else: content = response.content if not isinstance(text, bytes) or html: - text = force_text(text, encoding=response.charset) + text = str(text) content = content.decode(response.charset) text_repr = "'%s'" % text else: @@ -650,7 +649,7 @@ class SimpleTestCase(unittest.TestCase): optional.clean(input) self.assertEqual(context_manager.exception.messages, errors) # test required inputs - error_required = [force_text(required.error_messages['required'])] + error_required = [required.error_messages['required']] for e in required.empty_values: with self.assertRaises(ValidationError) as context_manager: required.clean(e)