authentik.lib.tests.test_sentry

test sentry integration

 1"""test sentry integration"""
 2
 3from django.test import TestCase
 4
 5from authentik.lib.sentry import SentryIgnoredException, should_ignore_exception
 6
 7
 8class TestSentry(TestCase):
 9    """test sentry integration"""
10
11    def test_error_not_sent(self):
12        """Test SentryIgnoredError not sent"""
13        self.assertTrue(should_ignore_exception(SentryIgnoredException()))
14
15    def test_error_sent(self):
16        """Test error sent"""
17        self.assertFalse(should_ignore_exception(ValueError()))
class TestSentry(django.test.testcases.TestCase):
 9class TestSentry(TestCase):
10    """test sentry integration"""
11
12    def test_error_not_sent(self):
13        """Test SentryIgnoredError not sent"""
14        self.assertTrue(should_ignore_exception(SentryIgnoredException()))
15
16    def test_error_sent(self):
17        """Test error sent"""
18        self.assertFalse(should_ignore_exception(ValueError()))

test sentry integration

def test_error_not_sent(self):
12    def test_error_not_sent(self):
13        """Test SentryIgnoredError not sent"""
14        self.assertTrue(should_ignore_exception(SentryIgnoredException()))

Test SentryIgnoredError not sent

def test_error_sent(self):
16    def test_error_sent(self):
17        """Test error sent"""
18        self.assertFalse(should_ignore_exception(ValueError()))

Test error sent