#25056 closed Bug (fixed)
Tests fails when using Jinja2 2.6
| Reported by: | Vlastimil Zíma | Owned by: | nobody |
|---|---|---|---|
| Component: | Documentation | Version: | 1.8 |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
When I run tests on master (hash a570701) 6 of them fails with the same error. Is seems Django does not work with Jinja 2.6, but I found no minimal version required in documentation, so I expect 2.6 should work. Class jinja2.Environment does not have keep_trailing_newline argument in version 2.6.
Example traceback
======================================================================
ERROR: setUpClass (template_backends.test_jinja2.Jinja2Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/vlastimil/git/django/tests/template_backends/test_dummy.py", line 28, in setUpClass
cls.engine = cls.engine_class(params)
File "/home/vlastimil/git/django/django/template/backends/jinja2.py", line 35, in __init__
self.env = environment_cls(**options)
TypeError: __init__() got an unexpected keyword argument 'keep_trailing_newline'
Change History (3)
comment:1 by , 10 years ago
| Component: | Template system → Documentation |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
Note:
See TracTickets
for help on using tickets.
Indeed, we should document the minimum required version of Jinja2 for running Django's own tests in https://docs.djangoproject.com/en/1.8/internals/contributing/writing-code/unit-tests/#running-all-the-tests.
That only affects Django's own test suite. You can use older versions of Jinja2 with Django in general, provided you don't use options added in newer versions.