I use the pytest-django setting FAIL_INVALID_TEMPLATE_VARS
Now invalid vars get checked if pytest executes the code.
[pytest] DJANGO_SETTINGS_MODULE =