diff --git a/authentik/providers/saml/utils/__init__.py b/authentik/providers/saml/utils/__init__.py index a9487a696..16c18a18e 100644 --- a/authentik/providers/saml/utils/__init__.py +++ b/authentik/providers/saml/utils/__init__.py @@ -1,15 +1,6 @@ """Small helper functions""" import uuid -from django.http import HttpRequest, HttpResponse -from django.shortcuts import render -from django.template.context import Context - - -def render_xml(request: HttpRequest, template: str, ctx: Context) -> HttpResponse: - """Render template with content_type application/xml""" - return render(request, template, context=ctx, content_type="application/xml") - def get_random_id() -> str: """Random hex id""" diff --git a/authentik/recovery/tests.py b/authentik/recovery/tests.py index f696c2c98..39406d49d 100644 --- a/authentik/recovery/tests.py +++ b/authentik/recovery/tests.py @@ -32,3 +32,10 @@ class TestRecovery(TestCase): reverse("authentik_recovery:use-token", kwargs={"key": token.key}) ) self.assertEqual(int(self.client.session["_auth_user_id"]), token.user.pk) + + def test_recovery_view_invalid(self): + """Test recovery view with invalid token""" + response = self.client.get( + reverse("authentik_recovery:use-token", kwargs={"key": "abc"}) + ) + self.assertEqual(response.status_code, 404)