Updates tests for reading views

This commit is contained in:
Mouse Reeve 2021-06-08 14:42:55 -07:00
parent e65bc09e7a
commit a00fdc6864

View file

@ -56,7 +56,7 @@ class ReadingViews(TestCase):
) )
request.user = self.local_user request.user = self.local_user
with patch("bookwyrm.models.activitypub_mixin.broadcast_task.delay"): with patch("bookwyrm.models.activitypub_mixin.broadcast_task.delay"):
views.start_reading(request, self.book.id) views.StartReading.as_view()(request, self.book.id)
self.assertEqual(shelf.books.get(), self.book) self.assertEqual(shelf.books.get(), self.book)
@ -86,7 +86,7 @@ class ReadingViews(TestCase):
request = self.factory.post("") request = self.factory.post("")
request.user = self.local_user request.user = self.local_user
with patch("bookwyrm.models.activitypub_mixin.broadcast_task.delay"): with patch("bookwyrm.models.activitypub_mixin.broadcast_task.delay"):
views.start_reading(request, self.book.id) views.StartReading.as_view()(request, self.book.id)
self.assertFalse(to_read_shelf.books.exists()) self.assertFalse(to_read_shelf.books.exists())
self.assertEqual(shelf.books.get(), self.book) self.assertEqual(shelf.books.get(), self.book)
@ -112,7 +112,7 @@ class ReadingViews(TestCase):
request.user = self.local_user request.user = self.local_user
with patch("bookwyrm.models.activitypub_mixin.broadcast_task.delay"): with patch("bookwyrm.models.activitypub_mixin.broadcast_task.delay"):
views.finish_reading(request, self.book.id) views.FinishReading.as_view()(request, self.book.id)
self.assertEqual(shelf.books.get(), self.book) self.assertEqual(shelf.books.get(), self.book)