mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-26 19:41:11 +00:00
Fixes tests
This commit is contained in:
parent
5df8bf03e6
commit
6fa29a6293
1 changed files with 4 additions and 2 deletions
|
@ -74,11 +74,12 @@ class AnnouncementViews(TestCase):
|
|||
|
||||
def test_create_announcement(self):
|
||||
"""create a new announcement"""
|
||||
view = views.Announcements.as_view()
|
||||
view = views.EditAnnouncement.as_view()
|
||||
form = forms.AnnouncementForm()
|
||||
form.data["preview"] = "hi hi"
|
||||
form.data["start_date"] = "2021-05-20"
|
||||
form.data["user"] = self.local_user.id
|
||||
form.data["display_type"] = "warning-light"
|
||||
|
||||
request = self.factory.post("", form.data)
|
||||
request.user = self.local_user
|
||||
|
@ -97,11 +98,12 @@ class AnnouncementViews(TestCase):
|
|||
announcement = models.Announcement.objects.create(
|
||||
preview="hi", user=self.local_user
|
||||
)
|
||||
view = views.Announcement.as_view()
|
||||
view = views.EditAnnouncement.as_view()
|
||||
form = forms.AnnouncementForm(instance=announcement)
|
||||
form.data["preview"] = "hi hi"
|
||||
form.data["start_date"] = "2021-05-20"
|
||||
form.data["user"] = self.local_user.id
|
||||
form.data["display_type"] = "warning-light"
|
||||
|
||||
request = self.factory.post("", form.data)
|
||||
request.user = self.local_user
|
||||
|
|
Loading…
Reference in a new issue