mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-15 20:56:34 +00:00
Prefs mocks
This commit is contained in:
parent
acde30887d
commit
5e6b28bbc0
2 changed files with 7 additions and 3 deletions
|
@ -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"
|
||||
)
|
||||
|
|
|
@ -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())
|
||||
|
|
Loading…
Reference in a new issue