Prefs mocks

This commit is contained in:
Mouse Reeve 2021-12-09 20:30:53 -08:00
parent acde30887d
commit 5e6b28bbc0
2 changed files with 7 additions and 3 deletions

View file

@ -31,7 +31,7 @@ class BaseActivity(TestCase):
"""we're probably going to re-use this so why copy/paste"""
with patch("bookwyrm.suggested_users.rerank_suggestions_task.delay"), patch(
"bookwyrm.activitystreams.populate_stream_task.delay"
):
), patch("bookwyrm.lists_stream.populate_lists_task.delay"):
self.user = models.User.objects.create_user(
"mouse", "mouse@mouse.mouse", "mouseword", local=True, localname="mouse"
)

View file

@ -61,7 +61,9 @@ class BlockViews(TestCase):
request = self.factory.post("")
request.user = self.local_user
with patch("bookwyrm.activitystreams.remove_user_statuses_task.delay"):
with patch("bookwyrm.activitystreams.remove_user_statuses_task.delay"), patch(
"bookwyrm.lists_stream.remove_user_lists_task.delay"
):
view(request, self.remote_user.id)
block = models.UserBlocks.objects.get()
self.assertEqual(block.user_subject, self.local_user)
@ -76,7 +78,9 @@ class BlockViews(TestCase):
request = self.factory.post("")
request.user = self.local_user
with patch("bookwyrm.activitystreams.add_user_statuses_task.delay"):
with patch("bookwyrm.activitystreams.add_user_statuses_task.delay"), patch(
"bookwyrm.lists_stream.add_user_lists_task.delay"
):
views.unblock(request, self.remote_user.id)
self.assertFalse(models.UserBlocks.objects.exists())