From 94250dab4240c65d8c67b8fe03b4c06acd316bf5 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Fri, 10 Dec 2021 09:19:32 -0800 Subject: [PATCH] Mocks for list signals tests --- bookwyrm/tests/lists_stream/test_signals.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bookwyrm/tests/lists_stream/test_signals.py b/bookwyrm/tests/lists_stream/test_signals.py index 7d7cfee75..91c6b48f3 100644 --- a/bookwyrm/tests/lists_stream/test_signals.py +++ b/bookwyrm/tests/lists_stream/test_signals.py @@ -61,7 +61,8 @@ class ListsStreamSignals(TestCase): args = mock.call_args[0] self.assertEqual(args[0], self.local_user.id) - def test_remove_lists_on_block(self, _): + @patch("bookwyrm.activitystreams.remove_user_statuses_task.delay") + def test_remove_lists_on_block(self, *_): """don't show lists from blocked users""" with patch("bookwyrm.lists_stream.remove_user_lists_task.delay") as mock: models.UserBlocks.objects.create( @@ -73,7 +74,9 @@ class ListsStreamSignals(TestCase): self.assertEqual(args[0], self.local_user.id) self.assertEqual(args[1], self.remote_user.id) - def test_add_lists_on_unblock(self, _): + @patch("bookwyrm.activitystreams.remove_user_statuses_task.delay") + @patch("bookwyrm.activitystreams.add_user_statuses_task.delay") + def test_add_lists_on_unblock(self, *_): """re-add lists on unblock""" with patch("bookwyrm.lists_stream.remove_user_lists_task.delay"): block = models.UserBlocks.objects.create( @@ -88,7 +91,9 @@ class ListsStreamSignals(TestCase): self.assertEqual(args[0], self.local_user.id) self.assertEqual(args[1], self.remote_user.id) - def test_add_lists_on_unblock_reciprocal_block(self, _): + @patch("bookwyrm.activitystreams.remove_user_statuses_task.delay") + @patch("bookwyrm.activitystreams.add_user_statuses_task.delay") + def test_add_lists_on_unblock_reciprocal_block(self, *_): """dont' re-add lists on unblock if there's a block the other way""" with patch("bookwyrm.lists_stream.remove_user_lists_task.delay"): block = models.UserBlocks.objects.create(