def test_homestream_get_audience(self, *_): """ get a list of users that should see a status """ status = models.Status.objects.create(user=self.remote_user, content="hi", privacy="public") users = activitystreams.HomeStream().get_audience(status) self.assertFalse(users.exists())
def test_homestream_get_audience_with_relationship(self, *_): """ get a list of users that should see a status """ self.remote_user.followers.add(self.local_user) status = models.Status.objects.create(user=self.remote_user, content="hi", privacy="public") users = activitystreams.HomeStream().get_audience(status) self.assertTrue(self.local_user in users) self.assertFalse(self.another_user in users)
def test_homestream_stream_users_with_mentions(self, *_): """ get a list of users that should see a status """ status = models.Status.objects.create(user=self.remote_user, content="hi", privacy="public") status.mention_users.add(self.local_user) users = activitystreams.HomeStream().stream_users(status) self.assertFalse(self.local_user in users) self.assertFalse(self.another_user in users)