mirror of
https://github.com/django/django.git
synced 2025-11-03 21:25:09 +00:00
Fixed #27140 -- Prevented template rendering from hiding a property's TypeError.
This commit is contained in:
parent
65ec8fa8ca
commit
59afe61a97
3 changed files with 11 additions and 3 deletions
|
|
@ -237,3 +237,8 @@ class FilterSyntaxTests(SimpleTestCase):
|
|||
"""
|
||||
with self.assertRaises(AttributeError):
|
||||
self.engine.render_to_string('filter-syntax25', {'var': SomeClass()})
|
||||
|
||||
@setup({'template': '{{ var.type_error_attribute }}'})
|
||||
def test_type_error_attribute(self):
|
||||
with self.assertRaises(TypeError):
|
||||
self.engine.render_to_string('template', {'var': SomeClass()})
|
||||
|
|
|
|||
|
|
@ -137,6 +137,10 @@ class SomeClass:
|
|||
def attribute_error_attribute(self):
|
||||
raise AttributeError
|
||||
|
||||
@property
|
||||
def type_error_attribute(self):
|
||||
raise TypeError
|
||||
|
||||
|
||||
class OtherClass:
|
||||
def method(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue