Skip to content

Commit 8878809

Browse files
committed
Add coverage for django templates
1 parent a0a50fa commit 8878809

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

airlock/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ def get_env_var(name):
113113
"builtins": [
114114
"slippers.templatetags.slippers", # required for assets library
115115
],
116+
"debug": get_env_var("DJANGO_DEBUG") == "True"
116117
},
117118
},
118119
]

pyproject.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ DJANGO_SETTINGS_MODULE = "airlock.settings"
2020
branch = true
2121
# Required to get full coverage when using Playwright
2222
concurrency = ["greenlet", "thread"]
23+
plugins = [
24+
"django_coverage_plugin",
25+
]
26+
omit = [
27+
"assets/*",
28+
]
2329

2430
[tool.coverage.report]
2531
fail_under = 100
@@ -32,3 +38,6 @@ exclude_also = [
3238
# this indicates that a method should be defined in a subclass
3339
"raise NotImplementedError",
3440
]
41+
42+
[tool.coverage.django_coverage_plugin]
43+
template_extensions = "html"

requirements.dev.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ pytest-cov
99
pytest-django
1010
pytest-playwright
1111
responses
12+
django_coverage_plugin

requirements.dev.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,12 @@ coverage==7.4.0 \
167167
--hash=sha256:ea81d8f9691bb53f4fb4db603203029643caffc82bf998ab5b59ca05560f4c06
168168
# via
169169
# coverage
170+
# django-coverage-plugin
170171
# pytest-cov
172+
django-coverage-plugin==3.1.0 \
173+
--hash=sha256:223d34bf92bebadcb8b7b89932480e41c7bd98b44a8156934488fbe7f4a71f99 \
174+
--hash=sha256:eb0ea8ffdb0db11a02994fc99be6500550efb496c350d709f418ff3d8e553a67
175+
# via -r requirements.dev.in
171176
greenlet==3.0.3 \
172177
--hash=sha256:01bc7ea167cf943b4c802068e178bbf70ae2e8c080467070d01bfa02f337ee67 \
173178
--hash=sha256:0448abc479fab28b00cb472d278828b3ccca164531daab4e970a0458786055d6 \

0 commit comments

Comments
 (0)