1
0
mirror of https://github.com/django/django.git synced 2025-01-09 09:55:57 +00:00
django/tests/forms_tests/tests/__init__.py
Mariusz Felisiak 98756c685e Refs #32339 -- Changed default form and formset rendering style to div-based.
Per deprecation timeline.

This also removes "django/forms/default.html" and
"django/forms/formsets/default.html" templates.
2023-01-17 11:49:15 +01:00

17 lines
424 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(
FORM_RENDERER="django.forms.renderers.Jinja2",
TEMPLATES={"BACKEND": "django.template.backends.jinja2.Jinja2"},
)(test_func)