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

Made bytes and str return types no longer mutually exclusive in lazy().

They are no longer special cased.
This commit is contained in:
Ran Benita
2019-05-03 13:03:14 +03:00
committed by Mariusz Felisiak
parent 459f30f73e
commit a57d5d9bbc
2 changed files with 1 additions and 10 deletions

View File

@@ -234,9 +234,7 @@ class FunctionalTests(SimpleTestCase):
def test_lazy_bytes_and_str_result_classes(self):
lazy_obj = lazy(lambda: "test", str, bytes)
msg = "Cannot call lazy() with both bytes and text return types."
with self.assertRaisesMessage(ValueError, msg):
lazy_obj()
self.assertEqual(str(lazy_obj()), "test")
def test_lazy_str_cast_mixed_result_types(self):
lazy_value = lazy(lambda: [1], str, list)()