mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2025-01-10 17:25:35 +00:00
Mocks inbox and search tests
This commit is contained in:
parent
3ad0a5d073
commit
495bf203b0
3 changed files with 11 additions and 4 deletions
|
@ -75,7 +75,9 @@ class InboxRemove(TestCase):
|
|||
|
||||
def test_handle_remove_book_from_list(self):
|
||||
"""listing a book"""
|
||||
with patch("bookwyrm.models.activitypub_mixin.broadcast_task.apply_async"):
|
||||
with patch(
|
||||
"bookwyrm.models.activitypub_mixin.broadcast_task.apply_async"
|
||||
), patch("bookwyrm.lists_stream.remove_list_task.delay"):
|
||||
booklist = models.List.objects.create(
|
||||
name="test list",
|
||||
user=self.local_user,
|
||||
|
|
|
@ -50,7 +50,9 @@ class InboxUpdate(TestCase):
|
|||
|
||||
def test_update_list(self):
|
||||
"""a new list"""
|
||||
with patch("bookwyrm.models.activitypub_mixin.broadcast_task.apply_async"):
|
||||
with patch(
|
||||
"bookwyrm.models.activitypub_mixin.broadcast_task.apply_async"
|
||||
), patch("bookwyrm.lists_stream.remove_list_task.delay"):
|
||||
book_list = models.List.objects.create(
|
||||
name="hi", remote_id="https://example.com/list/22", user=self.local_user
|
||||
)
|
||||
|
@ -69,7 +71,8 @@ class InboxUpdate(TestCase):
|
|||
"curation": "curated",
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
}
|
||||
views.inbox.activity_task(activity)
|
||||
with patch("bookwyrm.lists_stream.remove_list_task.delay"):
|
||||
views.inbox.activity_task(activity)
|
||||
book_list.refresh_from_db()
|
||||
self.assertEqual(book_list.name, "Test List")
|
||||
self.assertEqual(book_list.curation, "curated")
|
||||
|
|
|
@ -140,7 +140,9 @@ class Views(TestCase):
|
|||
|
||||
def test_search_lists(self):
|
||||
"""searches remote connectors"""
|
||||
with patch("bookwyrm.models.activitypub_mixin.broadcast_task.apply_async"):
|
||||
with patch(
|
||||
"bookwyrm.models.activitypub_mixin.broadcast_task.apply_async"
|
||||
), patch("bookwyrm.lists_stream.remove_list_task.delay"):
|
||||
booklist = models.List.objects.create(
|
||||
user=self.local_user, name="test list"
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue