From 919d59811f10f5a0101aac7b854aad5ec13d1b2a Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Sat, 10 Feb 2018 08:44:39 -0800 Subject: [PATCH] Refs #27795 -- Removed force_text() usage in django/test/testcases.py. --- django/test/testcases.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/django/test/testcases.py b/django/test/testcases.py index 58f1f20032..a9a432fa21 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)