1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Refs #23919 -- Removed unneeded str() calls

This commit is contained in:
Claude Paroz
2017-01-20 10:20:53 +01:00
parent 4e729feaa6
commit 042b7350a0
47 changed files with 116 additions and 164 deletions

View File

@@ -12,14 +12,12 @@ from django.utils.http import urlquote_plus
class TestEncodingUtils(unittest.TestCase):
def test_force_text_exception(self):
"""
Broken __unicode__/__str__ actually raises an error.
Broken __str__ actually raises an error.
"""
class MyString:
def __str__(self):
return b'\xc3\xb6\xc3\xa4\xc3\xbc'
__unicode__ = __str__
# str(s) raises a TypeError if the result is not a text type.
with self.assertRaises(TypeError):
force_text(MyString())