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:
committed by
Mariusz Felisiak
parent
459f30f73e
commit
a57d5d9bbc
@@ -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)()
|
||||
|
||||
Reference in New Issue
Block a user