Adds individual announcement page test

This commit is contained in:
Mouse Reeve 2021-05-20 12:14:57 -07:00
parent 44e8db3f33
commit fdb315d2ac

View file

@ -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)