1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #12070. Fixed a case where var._whatever wasn't raising a TemplateSyntaxError.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12539 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Joseph Kocherhans
2010-02-23 18:50:57 +00:00
parent 7352238e16
commit fd233f40d1
2 changed files with 15 additions and 2 deletions

View File

@@ -76,6 +76,13 @@ u"Some 'Bad' News"
[]
>>> fe.var
u'Some "Good" News'
Filtered variables should reject access of attributes beginning with underscores.
>>> FilterExpression('article._hidden|upper', p)
Traceback (most recent call last):
...
TemplateSyntaxError: Variables and attributes may not begin with underscores: 'article._hidden'
"""
variable_parsing = r"""
@@ -105,4 +112,10 @@ u'Some "Good" News'
>>> Variable(ur"'Some \'Better\' News'").resolve(c)
u"Some 'Better' News"
Variables should reject access of attributes beginning with underscores.
>>> Variable('article._hidden')
Traceback (most recent call last):
...
TemplateSyntaxError: Variables and attributes may not begin with underscores: 'article._hidden'
"""