Skip to main content

require_jinja2

Decorator to enable a Jinja2 template engine in addition to the regular Django template engine for a test or skip it if Jinja2 isn't available.

def require_jinja2(
test_func: callable
) - > function

Decorator to enable a Jinja2 template engine in addition to the regular Django template engine for a test or skip it if Jinja2 isn't available.

Parameters

NameTypeDescription
test_funccallableThe test function or method to be decorated with Jinja2 support

Returns

TypeDescription
functionThe wrapped test function with modified Django settings and conditional skip logic applied