Skip to content

Commit ceb5eb3

Browse files
authored
chore: Bump coverage to 100% (#49)
1 parent 9fd09c5 commit ceb5eb3

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ jobs:
7777
pattern: coverage-data-*
7878
merge-multiple: true
7979

80-
- name: Combine coverage and fail if it's <96%
80+
- name: Combine coverage and fail if it's <100%
8181
run: |
8282
python -m coverage combine
8383
python -m coverage html --skip-covered --skip-empty
84-
python -m coverage report --fail-under=96
84+
python -m coverage report --fail-under=100
8585
echo "## Coverage summary" >> $GITHUB_STEP_SUMMARY
8686
python -m coverage report --format=markdown >> $GITHUB_STEP_SUMMARY
8787

src/django_sys_indicator/conf.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,5 @@ def SYSTEM_INDICATOR_LABEL(self) -> str: # noqa: N802
3434
def SYSTEM_INDICATOR_COLORS(self) -> dict[str, tuple[str, str]]: # noqa: N802
3535
return getattr(dj_settings, "SYSTEM_INDICATOR_COLORS", DEFAULT_COLOURS)
3636

37-
@property
38-
def SYSTEM_INDICATOR_EXCLUSIONS(self) -> Sequence[str]: # noqa: N802
39-
return getattr(dj_settings, "SYSTEM_INDICATOR_EXCLUSIONS", [])
40-
4137

4238
settings = Settings()

tests/settings.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
},
1616
}
1717

18+
INSTALLED_APPS = ["django_sys_indicator"]
19+
1820
TEMPLATES = [
1921
{
2022
"BACKEND": "django.template.backends.django.DjangoTemplates",
@@ -35,3 +37,7 @@
3537
USE_L10N = True
3638

3739
USE_TZ = True
40+
41+
PASSWORD_HASHERS = [
42+
"django.contrib.auth.hashers.MD5PasswordHasher",
43+
]

tests/test_middleware.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ def get_response(request: HttpRequest) -> HttpResponse:
2222

2323
self.middleware = SystemIndicatorMiddleware(get_response)
2424

25+
@override_settings(SYSTEM_INDICATOR_ENABLED=True)
26+
def test_content_length(self):
27+
self.response["Content-Length"] = 6553
28+
29+
response = self.middleware(self.request)
30+
content = response.content.decode(response.charset)
31+
assert settings.SYSTEM_INDICATOR_LABEL in content
32+
2533
@override_settings(SYSTEM_INDICATOR_ENABLED=True)
2634
def test_invalid_content(self):
2735
self.response = HttpResponse("<html><body></body></html>")

0 commit comments

Comments
 (0)