From 1b07a0021ad61f21f4414e8bb9045d605ce87f64 Mon Sep 17 00:00:00 2001 From: Derek Date: Wed, 2 Sep 2020 22:17:44 -0400 Subject: add timeline view add timeline route --- pydis_site/apps/home/urls.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pydis_site/apps/home/urls.py') diff --git a/pydis_site/apps/home/urls.py b/pydis_site/apps/home/urls.py index 61e87a39..cf0c7457 100644 --- a/pydis_site/apps/home/urls.py +++ b/pydis_site/apps/home/urls.py @@ -6,7 +6,7 @@ from django.contrib.messages import ERROR from django.urls import include, path from pydis_site.utils.views import MessageRedirectView -from .views import AccountDeleteView, AccountSettingsView, HomeView +from .views import AccountDeleteView, AccountSettingsView, HomeView, timeline app_name = 'home' urlpatterns = [ @@ -38,4 +38,5 @@ urlpatterns = [ path('admin/', admin.site.urls), path('notifications/', include('django_nyt.urls')), + path('timeline/', timeline), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) -- cgit v1.2.3 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(-) (limited to 'pydis_site/apps/home/urls.py') 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