summaryrefslogtreecommitdiff
path: root/tests/utils_tests/test_functional.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/utils_tests/test_functional.py')
-rw-r--r--tests/utils_tests/test_functional.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/utils_tests/test_functional.py b/tests/utils_tests/test_functional.py
index 66a6f59cf6..2cf399f892 100644
--- a/tests/utils_tests/test_functional.py
+++ b/tests/utils_tests/test_functional.py
@@ -130,3 +130,18 @@ class FunctionalTestCase(unittest.TestCase):
self.assertEqual(lazy_a(), lazy_b())
self.assertNotEqual(lazy_b(), lazy_c())
+
+ def test_lazy_repr_text(self):
+ original_object = 'Lazy translation text'
+ lazy_obj = lazy(lambda: original_object, six.text_type)
+ self.assertEquals(repr(original_object), repr(lazy_obj()))
+
+ def test_lazy_repr_int(self):
+ original_object = 15
+ lazy_obj = lazy(lambda: original_object, int)
+ self.assertEquals(repr(original_object), repr(lazy_obj()))
+
+ def test_lazy_repr_bytes(self):
+ original_object = b'J\xc3\xbcst a str\xc3\xadng'
+ lazy_obj = lazy(lambda: original_object, bytes)
+ self.assertEquals(repr(original_object), repr(lazy_obj()))