From ee9c5a2a4b3cf2f11692ecab8146c6102c5a537e Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Tue, 3 Aug 2021 12:27:42 -0700 Subject: [PATCH] Adds mock to fields --- bookwyrm/tests/models/test_fields.py | 1 + bookwyrm/tests/views/test_helpers.py | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/bookwyrm/tests/models/test_fields.py b/bookwyrm/tests/models/test_fields.py index c234ffd0..8489b49f 100644 --- a/bookwyrm/tests/models/test_fields.py +++ b/bookwyrm/tests/models/test_fields.py @@ -186,6 +186,7 @@ class ActivitypubFields(TestCase): @patch("bookwyrm.models.activitypub_mixin.ObjectMixin.broadcast") @patch("bookwyrm.activitystreams.ActivityStream.add_status") + @patch("bookwyrm.suggested_users.rerank_suggestions_task.delay") def test_privacy_field_set_activity_from_field(self, *_): """translate between to/cc fields and privacy""" user = User.objects.create_user( diff --git a/bookwyrm/tests/views/test_helpers.py b/bookwyrm/tests/views/test_helpers.py index bfa9d82e..b30ac8ca 100644 --- a/bookwyrm/tests/views/test_helpers.py +++ b/bookwyrm/tests/views/test_helpers.py @@ -21,15 +21,16 @@ class ViewsHelpers(TestCase): """we need basic test data and mocks""" self.factory = RequestFactory() with patch("bookwyrm.suggested_users.rerank_suggestions_task.delay"): - self.local_user = models.User.objects.create_user( - "mouse@local.com", - "mouse@mouse.com", - "mouseword", - local=True, - discoverable=True, - localname="mouse", - remote_id="https://example.com/users/mouse", - ) + with patch("bookwyrm.suggested_users.rerank_user_task.delay"): + self.local_user = models.User.objects.create_user( + "mouse@local.com", + "mouse@mouse.com", + "mouseword", + local=True, + discoverable=True, + localname="mouse", + remote_id="https://example.com/users/mouse", + ) with patch("bookwyrm.models.user.set_remote_server.delay"): self.remote_user = models.User.objects.create_user( "rat",