mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Refs #28358 -- Fixed infinite recursion in LazyObject.__getattribute__().
Regression in 97d7990abd.
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
Co-authored-by: Theo Alexiou <theofilosalexiou@gmail.com>
This commit is contained in:
committed by
Mariusz Felisiak
parent
a94ae4cb11
commit
b2ed0d78f2
@@ -58,6 +58,14 @@ class LazyObjectTestCase(TestCase):
|
||||
obj = self.lazy_wrap(Foo())
|
||||
self.assertEqual(obj.foo, "bar")
|
||||
|
||||
def test_getattr_falsey(self):
|
||||
class Thing:
|
||||
def __getattr__(self, key):
|
||||
return []
|
||||
|
||||
obj = self.lazy_wrap(Thing())
|
||||
self.assertEqual(obj.main, [])
|
||||
|
||||
def test_setattr(self):
|
||||
obj = self.lazy_wrap(Foo())
|
||||
obj.foo = "BAR"
|
||||
|
||||
Reference in New Issue
Block a user