mirror of
https://github.com/django/django.git
synced 2025-11-25 05:04:26 +00:00
Fixed #32208 -- Allowed adding lazy() objects.
Co-authored-by: Claude Paroz <claude@2xlibre.net>
This commit is contained in:
parent
fe886eee36
commit
577f2338f1
3 changed files with 28 additions and 0 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue