From ee301afa6161613ad9fb59823909c8b1ceaa6889 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Thu, 6 Jan 2022 09:55:35 -0800 Subject: [PATCH] Adds tests for views --- bookwyrm/tests/views/landing/test_landing.py | 22 +++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/bookwyrm/tests/views/landing/test_landing.py b/bookwyrm/tests/views/landing/test_landing.py index 82991917..1eff8ed5 100644 --- a/bookwyrm/tests/views/landing/test_landing.py +++ b/bookwyrm/tests/views/landing/test_landing.py @@ -49,7 +49,27 @@ class LandingViews(TestCase): def test_about_page(self): """there are so many views, this just makes sure it LOADS""" - view = views.About.as_view() + view = views.about + request = self.factory.get("") + request.user = self.local_user + result = view(request) + self.assertIsInstance(result, TemplateResponse) + validate_html(result.render()) + self.assertEqual(result.status_code, 200) + + def test_conduct_page(self): + """there are so many views, this just makes sure it LOADS""" + view = views.conduct + request = self.factory.get("") + request.user = self.local_user + result = view(request) + self.assertIsInstance(result, TemplateResponse) + validate_html(result.render()) + self.assertEqual(result.status_code, 200) + + def test_privacy_page(self): + """there are so many views, this just makes sure it LOADS""" + view = views.privacy request = self.factory.get("") request.user = self.local_user result = view(request)