Skip to content

Commit 321ab61

Browse files
committed
Use django-coverage-plugin to check templates
Try this plyugin to find out templates that are not used from this repository and can be removed from here. Related #12086
1 parent fcd84ef commit 321ab61

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

.coveragerc

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ omit =
1010
rtd_tests/*
1111
*/**/tests/**
1212
wsgi.py
13+
plugins = django_coverage_plugin
1314

1415
[report]
1516
exclude_lines =

readthedocs/settings/test.py

+9
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@ class CommunityTestSettings(CommunityBaseSettings):
3737
}
3838
}
3939

40+
@property
41+
def TEMPLATES(self):
42+
templates = super().TEMPLATES
43+
44+
# Set DEBUG on templates to allow running Django coverage plugin
45+
templates[0]["OPTIONS"]["debug"] = True
46+
47+
return templates
48+
4049
@property
4150
def PASSWORD_HASHERS(self):
4251
# Speed up tests by using a fast password hasher as the default.

requirements/testing.in

+2
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ pytest-cov
1212
pytest-mock
1313

1414
requests-mock
15+
16+
django_coverage_plugin

requirements/testing.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ colorama==0.4.6
7979
# -r requirements/pip.txt
8080
# bumpver
8181
coverage[toml]==7.8.0
82-
# via pytest-cov
82+
# via
83+
# django-coverage-plugin
84+
# pytest-cov
8385
cron-descriptor==1.4.5
8486
# via
8587
# -r requirements/pip.txt
@@ -138,6 +140,8 @@ django-celery-beat==2.7.0
138140
# via -r requirements/pip.txt
139141
django-cors-headers==4.7.0
140142
# via -r requirements/pip.txt
143+
django-coverage-plugin==3.1.0
144+
# via -r requirements/testing.in
141145
django-crispy-forms==1.14.0
142146
# via -r requirements/pip.txt
143147
django-csp==3.8

0 commit comments

Comments
 (0)