Adds broadcast mock to edit book tests

This commit is contained in:
Mouse Reeve 2021-03-08 08:51:54 -08:00
parent 6d9c024e0e
commit d3162e12db

View file

@ -112,6 +112,7 @@ class BookViews(TestCase):
request = self.factory.post('', form.data) request = self.factory.post('', form.data)
request.user = self.local_user request.user = self.local_user
with patch('bookwyrm.models.activitypub_mixin.broadcast_task.delay'):
view(request, self.book.id) view(request, self.book.id)
self.book.refresh_from_db() self.book.refresh_from_db()
@ -132,6 +133,7 @@ class BookViews(TestCase):
request = self.factory.post('', form.data) request = self.factory.post('', form.data)
request.user = self.local_user request.user = self.local_user
with patch('bookwyrm.models.activitypub_mixin.broadcast_task.delay'):
view(request, self.book.id) view(request, self.book.id)
self.book.refresh_from_db() self.book.refresh_from_db()
self.assertEqual(self.book.title, 'New Title') self.assertEqual(self.book.title, 'New Title')