Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#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 Aymeric Augustin, 9 years ago

Component: Template systemDocumentation
Triage Stage: UnreviewedAccepted

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.

comment:2 by Tim Graham <timograham@…>, 9 years ago

Resolution: fixed
Status: newclosed

In ca58181:

Fixed #25056 -- Documented minimum version of jinja2 for testing.

comment:3 by Tim Graham <timograham@…>, 9 years ago

In cb3e9bc:

[1.8.x] Fixed #25056 -- Documented minimum version of jinja2 for testing.

Backport of ca58181bac5366d3a1fb44e1b49fe9e365095138 from master

Note: See TracTickets for help on using tickets.
Back to Top