diff options
| author | Gavin Wahl <gwahl@fusionbox.com> | 2014-08-22 10:31:26 -0600 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-12-26 11:30:34 -0500 |
| commit | b4e76f30d12bfa8a53cc297c60055c6f4629cc4c (patch) | |
| tree | 6566b4e56fbfe8b7b99041ffc49a37a3984b1b34 /tests/utils_tests/test_functional.py | |
| parent | c5fb34c47ef43fbd54e11fa6e72de326f5453f98 (diff) | |
Fixed #23346 -- Fixed lazy() to lookup methods on the real object, not resultclasses.
Co-Authored-By: Rocky Meza <rmeza@fusionbox.com>
Diffstat (limited to 'tests/utils_tests/test_functional.py')
| -rw-r--r-- | tests/utils_tests/test_functional.py | 14 |
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): |
