2015-01-02 03:28:53 +08:00
|
|
|
# Since this package contains a "jinja2" directory, this is required to
|
|
|
|
# silence an ImportWarning warning on Python 2.
|
|
|
|
from __future__ import absolute_import
|
|
|
|
|
2014-12-15 04:22:57 +08:00
|
|
|
from unittest import skipIf
|
|
|
|
|
2015-01-28 20:35:27 +08:00
|
|
|
from .test_dummy import TemplateStringsTests
|
|
|
|
|
2014-11-24 21:34:02 +08:00
|
|
|
try:
|
|
|
|
import jinja2
|
|
|
|
except ImportError:
|
2014-12-15 04:22:57 +08:00
|
|
|
jinja2 = None
|
|
|
|
Jinja2 = None
|
2014-11-24 21:34:02 +08:00
|
|
|
else:
|
|
|
|
from django.template.backends.jinja2 import Jinja2
|
2014-12-15 04:22:57 +08:00
|
|
|
|
|
|
|
|
|
|
|
@skipIf(jinja2 is None, "this test requires jinja2")
|
|
|
|
class Jinja2Tests(TemplateStringsTests):
|
|
|
|
|
|
|
|
engine_class = Jinja2
|
|
|
|
backend_name = 'jinja2'
|
|
|
|
options = {'keep_trailing_newline': True}
|