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
Jens Langhammer 3eed7bb010 lib: dont send any sentry events when testing
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
2022-01-01 18:56:14 +01:00

17 lines
517 B
Python

"""test sentry integration"""
from django.test import TestCase
from authentik.lib.sentry import SentryIgnoredException, before_send
class TestSentry(TestCase):
"""test sentry integration"""
def test_error_not_sent(self):
"""Test SentryIgnoredError not sent"""
self.assertIsNone(before_send({}, {"exc_info": (0, SentryIgnoredException(), 0)}))
def test_error_sent(self):
"""Test error sent"""
self.assertEqual(None, before_send({}, {"exc_info": (0, ValueError(), 0)}))