Where you need one mock, you probably need the other

This commit is contained in:
Mouse Reeve
2021-09-06 14:48:45 -07:00
parent a6b0ba1826
commit bb94995389
65 changed files with 204 additions and 68 deletions

View File

@ -16,7 +16,9 @@ class FollowViews(TestCase):
def setUp(self):
"""we need basic test data and mocks"""
self.factory = RequestFactory()
with patch("bookwyrm.suggested_users.rerank_suggestions_task.delay"):
with patch("bookwyrm.suggested_users.rerank_suggestions_task.delay"), patch(
"bookwyrm.activitystreams.populate_stream_task.delay"
):
self.local_user = models.User.objects.create_user(
"mouse@local.com",
"mouse@mouse.com",
@ -67,7 +69,9 @@ class FollowViews(TestCase):
def test_handle_follow_local_manually_approves(self):
"""send a follow request"""
with patch("bookwyrm.suggested_users.rerank_suggestions_task.delay"):
with patch("bookwyrm.suggested_users.rerank_suggestions_task.delay"), patch(
"bookwyrm.activitystreams.populate_stream_task.delay"
):
rat = models.User.objects.create_user(
"rat@local.com",
"rat@rat.com",
@ -91,7 +95,9 @@ class FollowViews(TestCase):
def test_handle_follow_local(self):
"""send a follow request"""
with patch("bookwyrm.suggested_users.rerank_suggestions_task.delay"):
with patch("bookwyrm.suggested_users.rerank_suggestions_task.delay"), patch(
"bookwyrm.activitystreams.populate_stream_task.delay"
):
rat = models.User.objects.create_user(
"rat@local.com",
"rat@rat.com",