mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Refs #23919 -- Removed six.PY2/PY3 usage
Thanks Tim Graham for the review.
This commit is contained in:
parent
e63d98b7be
commit
c716fe8782
111 changed files with 305 additions and 1296 deletions
|
@ -38,18 +38,11 @@ class FunctionalTestCase(unittest.TestCase):
|
|||
def test_lazy_object_to_string(self):
|
||||
|
||||
class Klazz(object):
|
||||
if six.PY3:
|
||||
def __str__(self):
|
||||
return "Î am ā Ǩlâzz."
|
||||
def __str__(self):
|
||||
return "Î am ā Ǩlâzz."
|
||||
|
||||
def __bytes__(self):
|
||||
return b"\xc3\x8e am \xc4\x81 binary \xc7\xa8l\xc3\xa2zz."
|
||||
else:
|
||||
def __unicode__(self):
|
||||
return "Î am ā Ǩlâzz."
|
||||
|
||||
def __str__(self):
|
||||
return b"\xc3\x8e am \xc4\x81 binary \xc7\xa8l\xc3\xa2zz."
|
||||
def __bytes__(self):
|
||||
return b"\xc3\x8e am \xc4\x81 binary \xc7\xa8l\xc3\xa2zz."
|
||||
|
||||
t = lazy(lambda: Klazz(), Klazz)()
|
||||
self.assertEqual(six.text_type(t), "Î am ā Ǩlâzz.")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue