From fdb315d2acb8b89bd15ae696dfb2f33a59ddb39b Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Thu, 20 May 2021 12:14:57 -0700 Subject: [PATCH] Adds individual announcement page test --- bookwyrm/tests/views/test_announcements.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/bookwyrm/tests/views/test_announcements.py b/bookwyrm/tests/views/test_announcements.py index 88dd7eca..d9999d5a 100644 --- a/bookwyrm/tests/views/test_announcements.py +++ b/bookwyrm/tests/views/test_announcements.py @@ -48,3 +48,18 @@ class AnnouncementViews(TestCase): self.assertIsInstance(result, TemplateResponse) result.render() self.assertEqual(result.status_code, 200) + + def test_announcement_page(self): + """there are so many views, this just makes sure it LOADS""" + announcement = models.Announcement.objects.create(preview="hi", user=self.local_user) + + view = views.Announcements.as_view() + request = self.factory.get("") + request.user = self.local_user + request.user.is_superuser = True + + result = view(request, announcement.id) + + self.assertIsInstance(result, TemplateResponse) + result.render() + self.assertEqual(result.status_code, 200)