def test_forward_entity__limited_content(self, mock_send): entity = Comment(actor_id=self.limited_reply.author.fid, id=self.limited_reply.fid) forward_entity(entity, self.limited_content.id) mock_send.assert_called_once_with(entity, self.limited_reply.author.federable, [( self.remote_limited_reply.author.handle, self.remote_limited_reply.author.key, self.remote_limited_reply.author.guid, )], parent_user=self.limited_content.author.federable)
def test_forward_entity(self, mock_send): entity = Comment(actor_id=self.reply.author.fid, id=self.reply.fid) forward_entity(entity, self.public_content.id) mock_send.assert_called_once_with(entity, self.reply.author.federable, [ self.remote_reply.author.handle, self.share.author.handle, self.share_reply.author.handle, ], parent_user=self.public_content.author.federable)
def test_forward_relayable(self, mock_send): entity = Comment(handle=self.reply.author.handle, guid=self.reply.guid) forward_entity(entity, self.public_content.id) mock_send.assert_called_once_with(entity, self.reply.author, [ generate_diaspora_profile_id(self.remote_reply.author.handle, self.remote_reply.author.guid), generate_diaspora_profile_id(self.share.author.handle, self.share.author.guid), generate_diaspora_profile_id(self.share_reply.author.handle, self.share_reply.author.guid), ], parent_user=self.public_content.author)
def test_forward_entity(self, mock_send): entity = Comment(actor_id=self.reply.author.fid, id=self.reply.fid) forward_entity(entity, self.public_content.id) mock_send.assert_called_once_with( entity, self.reply.author.federable, [ self.remote_reply.author.handle, self.share.author.handle, self.share_reply.author.handle, ], parent_user=self.public_content.author.federable)
def test_forward_entity__limited_content(self, mock_send): entity = Comment(actor_id=self.limited_reply.author.fid, id=self.limited_reply.fid) forward_entity(entity, self.limited_content.id) mock_send.assert_called_once_with( entity, self.limited_reply.author.federable, [( self.remote_limited_reply.author.handle, self.remote_limited_reply.author.key, self.remote_limited_reply.author.guid, )], parent_user=self.limited_content.author.federable)
def test_forward_entity(self, mock_send): entity = Comment(actor_id=self.reply.author.fid, id=self.reply.fid) forward_entity(entity, self.public_content.id) expected = { self.share_reply.author.get_recipient_for_visibility(Visibility.PUBLIC)["fid"], self.remote_reply.author.get_recipient_for_visibility(Visibility.PUBLIC)["fid"], self.share.author.get_recipient_for_visibility(Visibility.PUBLIC)["fid"], } mock_send.assert_called_once_with( entity, self.reply.author.federable, ANY, parent_user=self.public_content.author.federable, ) args, kwargs = mock_send.call_args_list[0] self.assertEqual({recipient["fid"] for recipient in args[2]}, expected)
def test_forward_entity__limited_content(self, mock_send): entity = Comment(handle=self.limited_reply.author.handle, guid=self.limited_reply.guid) forward_entity(entity, self.limited_content.id) mock_send.assert_called_once_with( entity, self.limited_reply.author, [( generate_diaspora_profile_id( self.remote_limited_reply.author.handle, self.remote_limited_reply.author.guid, ), self.remote_limited_reply.author.key, )], parent_user=self.limited_content.author)
def test_forward_entity__limited_content(self, mock_send): entity = Comment(actor_id=self.limited_reply.author.fid, id=self.limited_reply.fid) forward_entity(entity, self.limited_content.id) mock_send.assert_called_once_with(entity, self.limited_reply.author.federable, [ self.remote_limited_reply.author.get_recipient_for_visibility(Visibility.LIMITED), ], parent_user=self.limited_content.author.federable)