Skip to content

Commit

Permalink
Test the sentry client
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Lenc committed Nov 26, 2014
1 parent b9a1aed commit d6a6a9a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions user_management/tests/run.py
Expand Up @@ -41,6 +41,7 @@
'rest_framework.authentication.TokenAuthentication',
),
},
SENTRY_CLIENT='user_management.utils.sentry.SensitiveDjangoClient',
)

import django
Expand Down
Empty file.
16 changes: 16 additions & 0 deletions user_management/utils/tests/test_sentry.py
@@ -0,0 +1,16 @@
from raven.contrib.django.models import get_client
from rest_framework.test import APIRequestFactory

from user_management.models.tests.utils import APIRequestTestCase


class TestSentryClient(APIRequestTestCase):
def test_cookies(self):
request = APIRequestFactory().post('/')
request.COOKIES['username'] = 'jimmy'

raven = get_client()
result = raven.get_data_from_request(request)

self.assertFalse('cookies' in result['request'])
self.assertFalse('Cookie' in result['request']['headers'])

0 comments on commit d6a6a9a

Please sign in to comment.