Skip to content

Instantly share code, notes, and snippets.

View nikolaik's full-sized avatar
🤹‍♂️

Nikolai Røed Kristiansen nikolaik

🤹‍♂️
View GitHub Profile
@mathiasose
mathiasose / README.md
Last active March 14, 2018 16:04 — forked from jleclanche/test_templates.py
Test that Django templates render without errors

Django test (pytest) that checks that templates render without errors.

Uses pytest.mark.parameterize to test each template as an individual test.

Uses Django's Loader to find templates. This will also find templates in third-party apps (i.e. in your virtualenv). If you want to exclude these from being tested you will need to modify the code to fit your own project structure. The above code assumes a list of local apps in the settings file (INSTALLED_APPS = VENV_APPS + LOCAL_APPS).

License: CC0