diff --git a/authentik/recovery/tests.py b/authentik/recovery/tests.py index eea5549b0..ad53c6c5a 100644 --- a/authentik/recovery/tests.py +++ b/authentik/recovery/tests.py @@ -23,6 +23,13 @@ class TestRecovery(TestCase): self.assertIn(token.key, out.getvalue()) self.assertEqual(len(Token.objects.all()), 1) + def test_create_key_invalid(self): + """Test creation of a new key (invalid)""" + out = StringIO() + self.assertEqual(len(Token.objects.all()), 0) + call_command("create_recovery_key", "1", "foo", stderr=out) + self.assertIn("not found", out.getvalue()) + def test_recovery_view(self): """Test recovery view""" out = StringIO() diff --git a/authentik/root/settings.py b/authentik/root/settings.py index ba3246666..644e30e17 100644 --- a/authentik/root/settings.py +++ b/authentik/root/settings.py @@ -138,6 +138,7 @@ INSTALLED_APPS = [ "authentik.stages.user_logout", "authentik.stages.user_write", "authentik.tenants", + "authentik.managed", "rest_framework", "django_filters", "drf_spectacular", @@ -573,6 +574,5 @@ if DEBUG: os.environ[ENV_GIT_HASH_KEY] = "dev" INSTALLED_APPS.append("authentik.core") -INSTALLED_APPS.append("authentik.managed") j_print("Booting authentik", version=__version__)