This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
authentik/authentik/lib/tests/test_sentry.py

17 lines
515 B
Python
Raw Normal View History

2020-12-13 17:41:43 +00:00
"""test sentry integration"""
from django.test import TestCase
2020-12-13 18:37:47 +00:00
from authentik.lib.sentry import SentryIgnoredException, before_send
2020-12-13 17:41:43 +00:00
class TestSentry(TestCase):
"""test sentry integration"""
2020-12-13 19:38:50 +00:00
def test_error_not_sent(self):
2020-12-13 17:41:43 +00:00
"""Test SentryIgnoredError not sent"""
self.assertIsNone(before_send({}, {"exc_info": (0, SentryIgnoredException(), 0)}))
2020-12-13 17:41:43 +00:00
2020-12-13 19:38:50 +00:00
def test_error_sent(self):
2020-12-13 17:41:43 +00:00
"""Test error sent"""
self.assertEqual({}, before_send({}, {"exc_info": (0, ValueError(), 0)}))