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,7 +112,8 @@ class BookViews(TestCase):
request = self.factory.post('', form.data)
request.user = self.local_user
view(request, self.book.id)
with patch('bookwyrm.models.activitypub_mixin.broadcast_task.delay'):
view(request, self.book.id)
self.book.refresh_from_db()
self.assertEqual(self.book.title, 'New Title')
@ -132,7 +133,8 @@ class BookViews(TestCase):
request = self.factory.post('', form.data)
request.user = self.local_user
view(request, self.book.id)
with patch('bookwyrm.models.activitypub_mixin.broadcast_task.delay'):
view(request, self.book.id)
self.book.refresh_from_db()
self.assertEqual(self.book.title, 'New Title')
self.assertFalse(self.book.authors.exists())