Fixes announcement view test

This commit is contained in:
Mouse Reeve 2021-05-20 13:42:30 -07:00
parent cefc5994a6
commit ff3c4b8e73

View file

@ -114,7 +114,7 @@ class AnnouncementViews(TestCase):
announcement = models.Announcement.objects.create( announcement = models.Announcement.objects.create(
preview="hi", user=self.local_user preview="hi", user=self.local_user
) )
view = views.delete_announcement.as_view() view = views.delete_announcement
request = self.factory.post("") request = self.factory.post("")
request.user = self.local_user request.user = self.local_user
@ -128,8 +128,9 @@ class AnnouncementViews(TestCase):
"""display announcement on other pages""" """display announcement on other pages"""
view = views.User.as_view() view = views.User.as_view()
request = self.factory.get("") request = self.factory.get("")
request.user = self.local_user
result = view(request) result = view(request, self.local_user.localname)
self.assertIsInstance(result, TemplateResponse) self.assertIsInstance(result, TemplateResponse)
result.render() result.render()