From 0b36aad5c8f213bba1c90969444dd24a35811f0a Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Thu, 17 Dec 2020 00:17:20 +0100 Subject: [PATCH] admin: ensure clean_expired_models is called during tests --- authentik/admin/tests/test_api.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/authentik/admin/tests/test_api.py b/authentik/admin/tests/test_api.py index 6e0ee5547..5b4d66933 100644 --- a/authentik/admin/tests/test_api.py +++ b/authentik/admin/tests/test_api.py @@ -6,6 +6,7 @@ from django.test import TestCase from authentik import __version__ from authentik.core.models import Group, User +from authentik.core.tasks import clean_expired_models class TestAdminAPI(TestCase): @@ -21,6 +22,7 @@ class TestAdminAPI(TestCase): def test_tasks(self): """Test Task API""" + clean_expired_models.delay() response = self.client.get(reverse("authentik_api:admin_system_tasks-list")) self.assertEqual(response.status_code, 200) body = loads(response.content) @@ -30,6 +32,7 @@ class TestAdminAPI(TestCase): def test_tasks_retry(self): """Test Task API (retry)""" + clean_expired_models.delay() response = self.client.post( reverse( "authentik_api:admin_system_tasks-retry",