diff options
| author | Preston Timmons <prestontimmons@gmail.com> | 2015-05-08 15:10:36 -0500 |
|---|---|---|
| committer | Preston Timmons <prestontimmons@gmail.com> | 2015-05-21 09:12:06 -0500 |
| commit | 655f52491505932ef04264de2bce21a03f3a7cd0 (patch) | |
| tree | c38eca24b887466fc2385fc773ff34247567c732 /tests/template_tests/test_parser.py | |
| parent | 7b8008a078ffdfd18ebbe78fecbb92cdddf2f304 (diff) | |
Fixed #17085, #24783 -- Refactored template library registration.
* Converted the ``libraries`` and ``builtins`` globals of
``django.template.base`` into properties of the Engine class.
* Added a public API for explicit registration of libraries and builtins.
Diffstat (limited to 'tests/template_tests/test_parser.py')
| -rw-r--r-- | tests/template_tests/test_parser.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/template_tests/test_parser.py b/tests/template_tests/test_parser.py index dd22c83836..6ff57c2cf5 100644 --- a/tests/template_tests/test_parser.py +++ b/tests/template_tests/test_parser.py @@ -9,6 +9,7 @@ from django.template import Library, TemplateSyntaxError from django.template.base import ( TOKEN_BLOCK, FilterExpression, Parser, Token, Variable, ) +from django.template.defaultfilters import register as filter_library from django.utils import six @@ -24,7 +25,7 @@ class ParserTests(TestCase): def test_filter_parsing(self): c = {"article": {"section": "News"}} - p = Parser("") + p = Parser("", builtins=[filter_library]) def fe_test(s, val): self.assertEqual(FilterExpression(s, p).resolve(c), val) |
