From f391c33bdfa0558d9c618381f93709e989a8e14f Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sat, 14 May 2022 12:29:37 +0200 Subject: [PATCH] providers/oauth2: fix tests Signed-off-by: Jens Langhammer --- authentik/lib/sentry.py | 3 ++- authentik/lib/tests/test_sentry.py | 2 +- authentik/providers/oauth2/tests/test_authorize.py | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/authentik/lib/sentry.py b/authentik/lib/sentry.py index c65c96ddd..0868bd7e3 100644 --- a/authentik/lib/sentry.py +++ b/authentik/lib/sentry.py @@ -72,7 +72,7 @@ def sentry_init(**sentry_init_kwargs): ], before_send=before_send, release=f"authentik@{__version__}", - **kwargs + **kwargs, ) set_tag("authentik.build_hash", get_build_hash("tagged")) set_tag("authentik.env", get_env()) @@ -82,6 +82,7 @@ def sentry_init(**sentry_init_kwargs): env=kwargs["environment"], ) + def before_send(event: dict, hint: dict) -> Optional[dict]: """Check if error is database error, and ignore if so""" # pylint: disable=no-name-in-module diff --git a/authentik/lib/tests/test_sentry.py b/authentik/lib/tests/test_sentry.py index 8ad6f7954..958ef5041 100644 --- a/authentik/lib/tests/test_sentry.py +++ b/authentik/lib/tests/test_sentry.py @@ -13,4 +13,4 @@ class TestSentry(TestCase): def test_error_sent(self): """Test error sent""" - self.assertEqual(None, before_send({}, {"exc_info": (0, ValueError(), 0)})) + self.assertEqual({}, before_send({}, {"exc_info": (0, ValueError(), 0)})) diff --git a/authentik/providers/oauth2/tests/test_authorize.py b/authentik/providers/oauth2/tests/test_authorize.py index 6655250d2..828581f36 100644 --- a/authentik/providers/oauth2/tests/test_authorize.py +++ b/authentik/providers/oauth2/tests/test_authorize.py @@ -292,6 +292,7 @@ class TestAuthorize(OAuthTestCase): "component": "ak-stage-autosubmit", "type": ChallengeTypes.NATIVE.value, "url": "http://localhost", + "title": "Redirecting to app...", "attrs": { "access_token": token.access_token, "id_token": provider.encode(token.id_token.to_dict()),