From 3970df312a9390ea63e79859f4efa491d76155e5 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Tue, 3 Aug 2021 15:00:02 -0700 Subject: [PATCH] Fixes inbox tests --- bookwyrm/tests/views/inbox/test_inbox.py | 5 +++-- bookwyrm/tests/views/inbox/test_inbox_add.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bookwyrm/tests/views/inbox/test_inbox.py b/bookwyrm/tests/views/inbox/test_inbox.py index 9ca500c4..8e49d25a 100644 --- a/bookwyrm/tests/views/inbox/test_inbox.py +++ b/bookwyrm/tests/views/inbox/test_inbox.py @@ -28,7 +28,7 @@ class Inbox(TestCase): localname="mouse", ) local_user.remote_id = "https://example.com/user/mouse" - local_user.save(broadcast=False) + local_user.save(broadcast=False, update_fields=["remote_id"]) with patch("bookwyrm.models.user.set_remote_server.delay"): self.remote_user = models.User.objects.create_user( "rat", @@ -145,7 +145,8 @@ class Inbox(TestCase): ) self.assertTrue(views.inbox.is_blocked_activity(activity)) - def test_create_by_deactivated_user(self): + @patch("bookwyrm.suggested_users.remove_user_task.delay") + def test_create_by_deactivated_user(self, _): """don't let deactivated users post""" self.remote_user.delete(broadcast=False) self.assertTrue(self.remote_user.deleted) diff --git a/bookwyrm/tests/views/inbox/test_inbox_add.py b/bookwyrm/tests/views/inbox/test_inbox_add.py index 4280196b..07525c34 100644 --- a/bookwyrm/tests/views/inbox/test_inbox_add.py +++ b/bookwyrm/tests/views/inbox/test_inbox_add.py @@ -22,7 +22,7 @@ class InboxAdd(TestCase): localname="mouse", ) local_user.remote_id = "https://example.com/user/mouse" - local_user.save(broadcast=False) + local_user.save(broadcast=False, update_fields=["remote_id"]) with patch("bookwyrm.models.user.set_remote_server.delay"): self.remote_user = models.User.objects.create_user( "rat",