
* 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>
18 lines
494 B
Python
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()))
|