Refs #27795 -- Removed force_text() usage in django/test/testcases.py.

This commit is contained in:
Jon Dufresne 2018-02-10 08:44:39 -08:00 committed by Tim Graham
parent 1f3852b708
commit 919d59811f
1 changed files with 2 additions and 3 deletions

View File

@ -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)