forked from mirrors/bookwyrm
Updates tests for reading views
This commit is contained in:
parent
e65bc09e7a
commit
a00fdc6864
1 changed files with 3 additions and 3 deletions
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue