diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-04-10 20:49:45 +0000 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-04-10 20:49:45 +0000 |
| commit | 93240b7d903af86e135c3b1724a81d2daf31441f (patch) | |
| tree | 1f890c3fd6d7e7c19449dd2414ddadbe8e8d86df /tests | |
| parent | 28e5b665189548557993b522e3bd7adeed3f62ea (diff) | |
Fixed #17229 -- Allow 'True', 'False' and 'None' to resolve to the corresponding Python objects in templates.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17894 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/regressiontests/templates/tests.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py index e40ffcbdc4..3f230f8c13 100644 --- a/tests/regressiontests/templates/tests.py +++ b/tests/regressiontests/templates/tests.py @@ -372,13 +372,11 @@ class Templates(unittest.TestCase): with self.assertRaises(urlresolvers.NoReverseMatch): t.render(c) - - @override_settings(DEBUG=True, TEMPLATE_DEBUG = True) + @override_settings(DEBUG=True, TEMPLATE_DEBUG=True) def test_no_wrapped_exception(self): """ The template system doesn't wrap exceptions, but annotates them. Refs #16770 - """ c = Context({"coconuts": lambda: 42 / 0}) t = Template("{{ coconuts }}") @@ -387,7 +385,6 @@ class Templates(unittest.TestCase): self.assertEqual(cm.exception.django_template_source[1], (0, 14)) - def test_invalid_block_suggestion(self): # See #7876 from django.template import Template, TemplateSyntaxError @@ -610,6 +607,10 @@ class Templates(unittest.TestCase): # Call methods returned from dictionary lookups 'basic-syntax38': ('{{ var.callable }}', {"var": {"callable": lambda: "foo bar"}}, "foo bar"), + 'builtins01': ('{{ True }}', {}, "True"), + 'builtins02': ('{{ False }}', {}, "False"), + 'builtins03': ('{{ None }}', {}, "None"), + # 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"), |
