diff --git a/tests/utils_tests/test_functional.py b/tests/utils_tests/test_functional.py index 3bb50007c6..fc2256a1f2 100644 --- a/tests/utils_tests/test_functional.py +++ b/tests/utils_tests/test_functional.py @@ -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())