fixes mocks on tests

This commit is contained in:
Mouse Reeve
2021-02-07 11:29:24 -08:00
parent ad7a045582
commit bf6aca5122
5 changed files with 51 additions and 40 deletions

View File

@ -65,8 +65,9 @@ class ReadingViews(TestCase):
def test_start_reading_reshelf(self):
''' begin a book '''
to_read_shelf = self.local_user.shelf_set.get(identifier='to-read')
models.ShelfBook.objects.create(
shelf=to_read_shelf, book=self.book, user=self.local_user)
with patch('bookwyrm.models.activitypub_mixin.broadcast_task.delay'):
models.ShelfBook.objects.create(
shelf=to_read_shelf, book=self.book, user=self.local_user)
shelf = self.local_user.shelf_set.get(identifier='reading')
self.assertEqual(to_read_shelf.books.get(), self.book)
self.assertFalse(shelf.books.exists())