mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-26 01:50:34 +00:00
Patches broadcast call in reading test
This commit is contained in:
parent
c2d0c4b022
commit
7d1c5fb0f2
1 changed files with 7 additions and 3 deletions
|
@ -45,6 +45,7 @@ class ReadingViews(TestCase):
|
||||||
'start_date': '2020-01-05',
|
'start_date': '2020-01-05',
|
||||||
})
|
})
|
||||||
request.user = self.local_user
|
request.user = self.local_user
|
||||||
|
with patch('bookwyrm.broadcast.broadcast_task.delay'):
|
||||||
views.start_reading(request, self.book.id)
|
views.start_reading(request, self.book.id)
|
||||||
|
|
||||||
self.assertEqual(shelf.books.get(), self.book)
|
self.assertEqual(shelf.books.get(), self.book)
|
||||||
|
@ -73,6 +74,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.broadcast.broadcast_task.delay'):
|
||||||
views.start_reading(request, self.book.id)
|
views.start_reading(request, self.book.id)
|
||||||
|
|
||||||
self.assertFalse(to_read_shelf.books.exists())
|
self.assertFalse(to_read_shelf.books.exists())
|
||||||
|
@ -95,6 +97,8 @@ class ReadingViews(TestCase):
|
||||||
'id': readthrough.id,
|
'id': readthrough.id,
|
||||||
})
|
})
|
||||||
request.user = self.local_user
|
request.user = self.local_user
|
||||||
|
|
||||||
|
with patch('bookwyrm.broadcast.broadcast_task.delay'):
|
||||||
views.finish_reading(request, self.book.id)
|
views.finish_reading(request, self.book.id)
|
||||||
|
|
||||||
self.assertEqual(shelf.books.get(), self.book)
|
self.assertEqual(shelf.books.get(), self.book)
|
||||||
|
|
Loading…
Reference in a new issue