From 479624eab5074427345ea46e226acd58807d285b Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Mon, 12 Oct 2020 01:03:42 +0100 Subject: Add unit test for timeline page --- pydis_site/apps/home/tests/test_views.py | 7 +++++++ pydis_site/apps/home/urls.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pydis_site/apps/home/tests/test_views.py b/pydis_site/apps/home/tests/test_views.py index 572317a7..6ef4cf30 100644 --- a/pydis_site/apps/home/tests/test_views.py +++ b/pydis_site/apps/home/tests/test_views.py @@ -202,6 +202,13 @@ class TestIndexReturns200(TestCase): resp = self.client.get(url) self.assertEqual(resp.status_code, 200) +class TestTimelineReturns200(TestCase): + def test_timeline_returns_200(self): + """Check that the timeline page returns a HTTP 200 response.""" + url = reverse('timeline') + resp = self.client.get(url) + self.assertEqual(resp.status_code, 200) + class TestLoginCancelledReturns302(TestCase): def test_login_cancelled_returns_302(self): diff --git a/pydis_site/apps/home/urls.py b/pydis_site/apps/home/urls.py index cf0c7457..14d118f8 100644 --- a/pydis_site/apps/home/urls.py +++ b/pydis_site/apps/home/urls.py @@ -38,5 +38,5 @@ urlpatterns = [ path('admin/', admin.site.urls), path('notifications/', include('django_nyt.urls')), - path('timeline/', timeline), + path('timeline/', timeline, name="timeline"), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) -- cgit v1.2.3