def test_local_content_retraction_gets_sent(self, mock_send): user = UserFactory() content = ContentFactory(author=user.profile) self.assertTrue(content.local) mock_send.reset_mock() content.delete() mock_send.assert_called_once_with(content, content.author_id)
def test_local_content_retraction_gets_sent(self, mock_send): user = UserFactory() content = ContentFactory(author=user.profile) self.assertTrue(content.local) mock_send.reset_mock() content_id = content.id content.delete() mock_send.assert_called_once_with(send_content_retraction, content, content.author_id)
def test_exception_calls_logger(self, mock_logger, mock_send): user = UserFactory() content = ContentFactory(author=user.profile) content.delete() self.assertTrue(mock_logger.called)
def test_non_local_content_retraction_does_not_get_sent(self, mock_send): content = ContentFactory() content.delete() self.assertTrue(mock_send.called is False)
def test_non_local_content_retraction_does_not_get_sent(self, mock_send): content = ContentFactory() content.delete() mock_send.assert_not_called()