Files
authentik/authentik/lib/tests/test_sentry.py
Jens L. d09b7757b6 root: fix some cases of invalid data triggering exceptions (#14799)
* sentry: separate checker if exception should be ignored

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* use should_ignore_exception in flow executor (fix ParseError)

fix system exceptions for unsupported media type, json decode error

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* fix tests

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* improve API validation

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

---------

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
2025-06-24 22:42:59 +02:00

18 lines
494 B
Python

"""test sentry integration"""
from django.test import TestCase
from authentik.lib.sentry import SentryIgnoredException, should_ignore_exception
class TestSentry(TestCase):
"""test sentry integration"""
def test_error_not_sent(self):
"""Test SentryIgnoredError not sent"""
self.assertTrue(should_ignore_exception(SentryIgnoredException()))
def test_error_sent(self):
"""Test error sent"""
self.assertFalse(should_ignore_exception(ValueError()))