mirror of
https://github.com/django/django.git
synced 2024-12-23 01:25:58 +00:00
Add test for new __ne__ method on Promise.
This commit is contained in:
parent
d0ecefc2c9
commit
52d2a8b311
@ -64,3 +64,15 @@ class FunctionalTestCase(unittest.TestCase):
|
||||
|
||||
# check that it behaves like a property when there's no instance
|
||||
self.assertIsInstance(A.value, cached_property)
|
||||
|
||||
def test_lazy_equality(self):
|
||||
"""
|
||||
Tests that == and != work correctly for Promises.
|
||||
"""
|
||||
|
||||
lazy_a = lazy(lambda: 4, int)
|
||||
lazy_b = lazy(lambda: 4, int)
|
||||
lazy_c = lazy(lambda: 5, int)
|
||||
|
||||
self.assertEqual(lazy_a(), lazy_b())
|
||||
self.assertNotEqual(lazy_b(), lazy_c())
|
||||
|
Loading…
Reference in New Issue
Block a user