summaryrefslogtreecommitdiff
path: root/tests/regressiontests/utils/simplelazyobject.py
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2012-06-07 18:08:47 +0200
committerClaude Paroz <claude@2xlibre.net>2012-06-07 18:08:47 +0200
commit4a103086d5c67fa4fcc53c106c9fdf644c742dd8 (patch)
tree3df00600c27f6369f7561c3b8ddf2f97d2d341d9 /tests/regressiontests/utils/simplelazyobject.py
parent706fd9adc0b6587c7f96a834c757708e64fcf615 (diff)
Fixed #18269 -- Applied unicode_literals for Python 3 compatibility.
Thanks Vinay Sajip for the support of his django3 branch and Jannis Leidel for the review.
Diffstat (limited to 'tests/regressiontests/utils/simplelazyobject.py')
-rw-r--r--tests/regressiontests/utils/simplelazyobject.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/regressiontests/utils/simplelazyobject.py b/tests/regressiontests/utils/simplelazyobject.py
index 4ee822563e..982d2226e6 100644
--- a/tests/regressiontests/utils/simplelazyobject.py
+++ b/tests/regressiontests/utils/simplelazyobject.py
@@ -1,6 +1,9 @@
+from __future__ import unicode_literals
+
import copy
import pickle
+from django.test.utils import str_prefix
from django.utils.unittest import TestCase
from django.utils.functional import SimpleLazyObject, empty
@@ -51,10 +54,11 @@ class TestUtilsSimpleLazyObject(TestCase):
self.assertTrue("SimpleLazyObject" in repr(SimpleLazyObject(complex_object)))
def test_str(self):
- self.assertEqual("I am _ComplexObject('joe')", str(SimpleLazyObject(complex_object)))
+ self.assertEqual(str_prefix("I am _ComplexObject(%(_)s'joe')"),
+ str(SimpleLazyObject(complex_object)))
def test_unicode(self):
- self.assertEqual(u"joe", unicode(SimpleLazyObject(complex_object)))
+ self.assertEqual("joe", unicode(SimpleLazyObject(complex_object)))
def test_class(self):
# This is important for classes that use __class__ in things like