From 9fdcc7debddccf36c6681e52cf150f12afe1d26c Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Wed, 25 Jan 2023 09:32:45 -0800 Subject: [PATCH] Fixes mocks in tests --- bookwyrm/tests/test_signing.py | 3 ++- bookwyrm/tests/views/inbox/test_inbox.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bookwyrm/tests/test_signing.py b/bookwyrm/tests/test_signing.py index 26d5e99a9..961e45435 100644 --- a/bookwyrm/tests/test_signing.py +++ b/bookwyrm/tests/test_signing.py @@ -35,6 +35,7 @@ Sender = namedtuple("Sender", ("remote_id", "key_pair")) class Signature(TestCase): """signature test""" + # pylint: disable=invalid-name def setUp(self): """create users and test data""" with patch("bookwyrm.suggested_users.rerank_suggestions_task.delay"), patch( @@ -86,7 +87,7 @@ class Signature(TestCase): data = json.dumps(get_follow_activity(sender, self.rat)) digest = digest or make_digest(data) signature = make_signature(signer or sender, self.rat.inbox, now, digest) - with patch("bookwyrm.views.inbox.activity_task.delay"): + with patch("bookwyrm.views.inbox.activity_task.apply_async"): with patch("bookwyrm.models.user.set_remote_server.delay"): return self.send(signature, now, send_data or data, digest) diff --git a/bookwyrm/tests/views/inbox/test_inbox.py b/bookwyrm/tests/views/inbox/test_inbox.py index e328b1ba4..61acde5d3 100644 --- a/bookwyrm/tests/views/inbox/test_inbox.py +++ b/bookwyrm/tests/views/inbox/test_inbox.py @@ -15,6 +15,7 @@ from bookwyrm import models, views class Inbox(TestCase): """readthrough tests""" + # pylint: disable=invalid-name def setUp(self): """basic user and book data""" self.client = Client() @@ -119,7 +120,7 @@ class Inbox(TestCase): with patch("bookwyrm.views.inbox.has_valid_signature") as mock_valid: mock_valid.return_value = True - with patch("bookwyrm.views.inbox.activity_task.delay"): + with patch("bookwyrm.views.inbox.activity_task.apply_async"): result = self.client.post( "/inbox", json.dumps(activity), content_type="application/json" )