summaryrefslogtreecommitdiff
path: root/tests/regressiontests/templates
diff options
context:
space:
mode:
authorKaren Tracey <kmtracey@gmail.com>2010-03-22 19:08:04 +0000
committerKaren Tracey <kmtracey@gmail.com>2010-03-22 19:08:04 +0000
commited36a5f2cefcb5a055ec2ec0a275825226ee601a (patch)
tree2abc732e18f3af98d3827c0963ba30f1addb6ff9 /tests/regressiontests/templates
parentb2db1b24c665bb6bc0957ff3b57ffd85814919d3 (diff)
Fixed #12554 again: Corrected regression in silencing attribute lookups introduced in r12823, plus added a test for this so it doesn't regress again.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12834 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/templates')
-rw-r--r--tests/regressiontests/templates/tests.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py
index 303c365cc8..95bb45de43 100644
--- a/tests/regressiontests/templates/tests.py
+++ b/tests/regressiontests/templates/tests.py
@@ -101,6 +101,11 @@ class SilentGetItemClass(object):
def __getitem__(self, key):
raise SomeException
+class SilentAttrClass(object):
+ def b(self):
+ raise SomeException
+ b = property(b)
+
class UTF8Class:
"Class whose __str__ returns non-ASCII data"
def __str__(self):
@@ -471,8 +476,9 @@ class Templates(unittest.TestCase):
# regression test for ticket #12554
# make sure a silent_variable_failure Exception is supressed
- # on dictionary lookup
+ # on dictionary and attribute lookup
'basic-syntax28': ("{{ a.b }}", {'a': SilentGetItemClass()}, ('', 'INVALID')),
+ 'basic-syntax29': ("{{ a.b }}", {'a': SilentAttrClass()}, ('', 'INVALID')),
# List-index syntax allows a template to access a certain item of a subscriptable object.
'list-index01': ("{{ var.1 }}", {"var": ["first item", "second item"]}, "second item"),