Example #1
0
    def process_response(self, request, response):
        from raven_django.models import client

        if response.status_code != 404 or is_ignorable_404(request.get_full_path()) or not client.is_enabled():
            return response

        data = client.get_data_from_request(request)
        data.update({
            'level': logging.INFO,
            'logger': 'http404',
        })
        result = client.captureMessage(message='Page Not Found: %s' % request.build_absolute_uri(), data=data)
        if not result:
            return

        request.sentry = {
            'project_id': data.get('project', client.project),
            'id': client.get_ident(result),
        }
        return response
Example #2
0
 def test_basic(self, captureMessage):
     client.captureMessage(message='foo')
     captureMessage.assert_called_once_with(message='foo')
Example #3
0
 def test_basic(self, captureMessage):
     client.captureMessage(message='foo')
     captureMessage.assert_called_once_with(message='foo')