summaryrefslogtreecommitdiff
path: root/tests/utils_tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/utils_tests')
-rw-r--r--tests/utils_tests/test_functional.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/utils_tests/test_functional.py b/tests/utils_tests/test_functional.py
index 7d71f32415..e8956a7a29 100644
--- a/tests/utils_tests/test_functional.py
+++ b/tests/utils_tests/test_functional.py
@@ -22,6 +22,20 @@ class FunctionalTestCase(unittest.TestCase):
t = lazy(lambda: Klazz(), Klazz)()
self.assertIn('base_method', dir(t))
+ def test_lazy_base_class_override(self):
+ """Test that lazy finds the correct (overridden) method implementation"""
+
+ class Base(object):
+ def method(self):
+ return 'Base'
+
+ class Klazz(Base):
+ def method(self):
+ return 'Klazz'
+
+ t = lazy(lambda: Klazz(), Base)()
+ self.assertEqual(t.method(), 'Klazz')
+
def test_lazy_property(self):
class A(object):