def test_handle_send_is_called(self, mock_make, mock_send): send_profile_retraction(self.public_profile) mock_send.assert_called_once_with( "entity", self.public_profile, ['diaspora://[email protected]/profile/'], )
def federate_profile_retraction(instance, **kwargs): """Send out local profile retractions to the federation layer.""" if instance.is_local: logger.debug('federate_profile_retraction: Got local profile %s delete, sending out retraction', instance) try: # Don't enqueue, we must complete this before doing the delete send_profile_retraction(instance) except Exception as ex: logger.exception("Failed to federate_profile_retraction %s: %s", instance, ex)
def test_limited_profile_retraction_not_sent_to_relay(self, mock_make, mock_send): send_profile_retraction(self.limited_profile) mock_send.assert_called_once_with( "entity", self.limited_profile.federable, [ self.remote_profile.get_recipient_for_visibility(Visibility.LIMITED), ], )
def test_limited_profile_retraction_not_sent_to_relay(self, mock_make, mock_send): send_profile_retraction(self.limited_profile) mock_send.assert_called_once_with( "entity", self.limited_profile.federable, [ self.remote_profile.handle, ], )
def test_handle_send_is_called(self, mock_make, mock_send): send_profile_retraction(self.public_profile) mock_send.assert_called_once_with( "entity", self.public_profile.federable, [ self.remote_profile.get_recipient_for_visibility(Visibility.PUBLIC), ], )
def test_limited_profile_retraction_not_sent_to_relay( self, mock_make, mock_send): send_profile_retraction(self.limited_profile) mock_send.assert_called_once_with( "entity", self.limited_profile.federable, [ self.remote_profile.handle, ], )
def test_handle_send_is_called(self, mock_make, mock_send): send_profile_retraction(self.public_profile) mock_send.assert_called_once_with( "entity", self.public_profile.federable, [ '*****@*****.**', self.remote_profile.handle, ], )
def test_limited_profile_retraction_not_sent_to_relay( self, mock_make, mock_send): send_profile_retraction(self.limited_profile) mock_send.assert_called_once_with( "entity", self.limited_profile, [ generate_diaspora_profile_id(self.remote_profile.handle, self.remote_profile.guid), ], )
def federate_profile_retraction(instance, **kwargs): """Send out local profile retractions to the federation layer.""" if instance.is_local: logger.debug( 'federate_profile_retraction: Got local profile %s delete, sending out retraction', instance) try: # Don't enqueue, we must complete this before doing the delete send_profile_retraction(instance) except Exception as ex: logger.exception("Failed to federate_profile_retraction %s: %s", instance, ex)
def test_non_public_or_limited_profile_does_not_get_sent( self, mock_make, mock_send): send_profile_retraction(self.profile) self.assertTrue(mock_send.called is False)
def test_non_local_profile_does_not_get_sent(self, mock_make, mock_send): send_profile_retraction(self.remote_profile) self.assertTrue(mock_send.called is False)
def test_get_remote_followers_is_called(self, mock_followers, mock_make, mock_send): send_profile_retraction(self.public_profile) mock_followers.assert_called_once_with(self.public_profile)
def test_non_public_or_limited_profile_does_not_get_sent(self, mock_make, mock_send): send_profile_retraction(self.profile) self.assertTrue(mock_send.called is False)