forked from mirrors/bookwyrm
Adds individual announcement page test
This commit is contained in:
parent
44e8db3f33
commit
fdb315d2ac
1 changed files with 15 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue