1
0
mirror of https://github.com/django/django.git synced 2025-03-30 11:10:45 +00:00
David Smith d126eba363 Refs #32339 -- Deprecated default.html form template.
Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>
2022-05-17 11:16:54 +02:00

19 lines
569 B
Python

from unittest import skipIf
from django.test.utils import override_settings
try:
import jinja2
except ImportError:
jinja2 = None
def jinja2_tests(test_func):
test_func = skipIf(jinja2 is None, "this test requires jinja2")(test_func)
return override_settings(
# RemovedInDjango50Warning: When the deprecation ends, revert to
# FORM_RENDERER="django.forms.renderers.Jinja2",
FORM_RENDERER="django.forms.renderers.Jinja2DivFormRenderer",
TEMPLATES={"BACKEND": "django.template.backends.jinja2.Jinja2"},
)(test_func)