Skip to content

Commit

Permalink
include .coveragerc in testing-env; check url-definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
wfehr committed Jan 13, 2023
1 parent c05895f commit c450484
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
branch = True
source = time_wizard
omit =
migrations/*
tests/*
time_wizard/migrations/*
time_wizard/workarounds.py

[report]
exclude_lines =
Expand Down
1 change: 1 addition & 0 deletions Dockerfile.tests
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ COPY manage.py /home/app/manage.py
COPY setup.py /home/app/setup.py
COPY tox.ini /home/app/tox.ini
COPY README.rst /home/app/README.rst
COPY .coveragerc /home/app/.coveragerc
12 changes: 12 additions & 0 deletions tests/test_views.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import holidays
from django.test import RequestFactory, TestCase
from django.utils.timezone import now
from django.urls import reverse

from time_wizard.conf import TIME_WIZARD_COUNTRY_PROVINCES
from time_wizard.views import load_holidays, load_provinces
Expand Down Expand Up @@ -29,3 +30,14 @@ def test_load_provinces(self):
for province in TIME_WIZARD_COUNTRY_PROVINCES['US']:
html = '<option value="{0}">{0}</option>'.format(province)
self.assertIn(html, content)

def test_urls_definition(self):
urlconf = "time_wizard.urls"
cases = [
("/load-holidays", "ajax-load-holidays"),
("/load-provinces", "ajax-load-provinces"),
]
for expected_path, url_name in cases:
with self.subTest(url_name):
actual_path = reverse(url_name, urlconf=urlconf)
self.assertEqual(expected_path, actual_path)

0 comments on commit c450484

Please sign in to comment.