1
Fork 0

Add basic homepage test

This commit is contained in:
Jake Howard 2020-04-13 10:50:59 +01:00
parent a0cddae1c7
commit aa54319778
Signed by: jake
GPG key ID: 57AFB45680EDD477
4 changed files with 17 additions and 5 deletions

View file

@ -4,7 +4,10 @@ set -e
export PATH=env/bin:${PATH} export PATH=env/bin:${PATH}
coverage run manage.py test $@ coverage run --source=website manage.py test $@
coverage report
coverage html
echo "> Running formatter..." echo "> Running formatter..."
black website/ --check black website/ --check

View file

@ -14,6 +14,3 @@ force_grid_wrap=0
use_parentheses=True use_parentheses=True
line_length=88 line_length=88
not_skip=__init__.py not_skip=__init__.py
[coverage:run]
source = "website"

12
website/common/tests.py Normal file
View file

@ -0,0 +1,12 @@
from django.test import SimpleTestCase
from django.urls import reverse
class BaseTestCase(SimpleTestCase):
pass
class HomepageViewTestCase(BaseTestCase):
def test_accessible(self):
response = self.client.get(reverse("homepage"))
self.assertEqual(response.status_code, 200)

View file

@ -2,4 +2,4 @@ from django.urls import path
from . import views from . import views
urlpatterns = [path("", views.HomepageView.as_view())] urlpatterns = [path("", views.HomepageView.as_view(), name="homepage")]