Skip to content

Commit

Permalink
providers/oauth2: fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
  • Loading branch information
BeryJu committed May 14, 2022
1 parent 18f450b commit f391c33
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion authentik/lib/sentry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion authentik/lib/tests/test_sentry.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ def test_error_not_sent(self):

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)}))
1 change: 1 addition & 0 deletions authentik/providers/oauth2/tests/test_authorize.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ def test_full_form_post(self):
"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()),
Expand Down

0 comments on commit f391c33

Please sign in to comment.