Exemplo n.º 1
0
    def test_response_forbidden(self, mock_requests, mock_logger):
        mock_requests.delete.return_value = Mock(status_code=403)

        org = factories.Organization()

        response = delete_instance(org)
        self.assertEqual(response.status_code, 403)
        mock_logger.warning.assert_called_once_with(
            '{} (id={}, model={}) could not be created/fetched successfully '
            'on/from Track.'.format(org.name, org.id, 'Organization'))
Exemplo n.º 2
0
    def test_response_200_delete(self, mock_requests, mock_logger):
        mock_requests.delete.return_value = Mock(status_code=200)

        org = factories.Organization()

        response = delete_instance(org)
        self.assertEqual(response.status_code, 200)
        mock_logger.info.assert_called_once_with(
            'The request for {} (id={}, model={}) was successfully executed '
            'on Track.'.format(org.name, org.id, 'Organization'))
Exemplo n.º 3
0
def sync_delete_track_workflowlevel1(sender, instance, **kwargs):
    if settings.TOLA_TRACK_SYNC_ENABLED:
        tsync.delete_instance(instance)
Exemplo n.º 4
0
def sync_delete_track_organization(sender, instance, **kwargs):
    if settings.TOLA_TRACK_SYNC_ENABLED:
        tsync.delete_instance(instance)