From 8f3601d4cdfb0ea6a1dcd2f34250711ffd19c1b1 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Mon, 12 Apr 2021 06:44:50 -0700 Subject: [PATCH] Adds redis mocks to base model tests --- bookwyrm/tests/models/test_base_model.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bookwyrm/tests/models/test_base_model.py b/bookwyrm/tests/models/test_base_model.py index bbc6c4889..442f98ca1 100644 --- a/bookwyrm/tests/models/test_base_model.py +++ b/bookwyrm/tests/models/test_base_model.py @@ -57,6 +57,7 @@ class BaseModel(TestCase): base_model.set_remote_id(None, instance, False) self.assertIsNone(instance.remote_id) + @patch("bookwyrm.activitystreams.ActivityStream.add_status") def test_object_visible_to_user(self, _): """ does a user have permission to view an object """ obj = models.Status.objects.create( @@ -85,6 +86,7 @@ class BaseModel(TestCase): obj.mention_users.add(self.local_user) self.assertTrue(obj.visible_to_user(self.local_user)) + @patch("bookwyrm.activitystreams.ActivityStream.add_status") def test_object_visible_to_user_follower(self, _): """ what you can see if you follow a user """ self.remote_user.followers.add(self.local_user) @@ -104,6 +106,7 @@ class BaseModel(TestCase): obj.mention_users.add(self.local_user) self.assertTrue(obj.visible_to_user(self.local_user)) + @patch("bookwyrm.activitystreams.ActivityStream.add_status") def test_object_visible_to_user_blocked(self, _): """ you can't see it if they block you """ self.remote_user.blocks.add(self.local_user)