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

Fixed #32208 -- Allowed adding lazy() objects.

Co-authored-by: Claude Paroz <claude@2xlibre.net>
This commit is contained in:
Hasan Ramezani
2020-12-19 20:53:30 +01:00
committed by Mariusz Felisiak
parent fe886eee36
commit 577f2338f1
3 changed files with 28 additions and 0 deletions

View File

@@ -184,6 +184,11 @@ class FunctionalTests(SimpleTestCase):
with self.assertRaisesMessage(TypeError, msg):
Foo().cp
def test_lazy_add(self):
lazy_4 = lazy(lambda: 4, int)
lazy_5 = lazy(lambda: 5, int)
self.assertEqual(lazy_4() + lazy_5(), 9)
def test_lazy_equality(self):
"""
== and != work correctly for Promises.