From f308b7793ddfd0a5ea7e7a82c9aae3e63e524e2c Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sat, 28 Aug 2021 10:08:41 -0700 Subject: [PATCH] Adds test for followers only privacy level --- bookwyrm/tests/models/test_fields.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bookwyrm/tests/models/test_fields.py b/bookwyrm/tests/models/test_fields.py index 2520a2fd2..80b78231c 100644 --- a/bookwyrm/tests/models/test_fields.py +++ b/bookwyrm/tests/models/test_fields.py @@ -185,6 +185,17 @@ class ModelFields(TestCase): instance.set_field_from_activity(model_instance, data) self.assertEqual(model_instance.privacy_field, "unlisted") + data.to = ["http://user_remote/followers"] + data.cc = [] + instance.set_field_from_activity(model_instance, data) + self.assertEqual(model_instance.privacy_field, "followers") + + data.to = ["http://user_remote/followers"] + data.cc = ["http://mentioned_user/remote_id"] + instance.set_field_from_activity(model_instance, data) + self.assertEqual(model_instance.privacy_field, "followers") + + @patch("bookwyrm.models.activitypub_mixin.ObjectMixin.broadcast") @patch("bookwyrm.activitystreams.ActivityStream.add_status") def test_privacy_field_set_activity_from_field(self, *_):