From d5341c2284560e71731330d874d6ecc9c3c05a74 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 15 Nov 2021 19:53:08 +0100 Subject: [PATCH] managed: add tests Signed-off-by: Jens Langhammer --- authentik/managed/tasks.py | 2 +- authentik/managed/tests.py | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 authentik/managed/tests.py diff --git a/authentik/managed/tasks.py b/authentik/managed/tasks.py index 978b458b0..5d2ebd996 100644 --- a/authentik/managed/tasks.py +++ b/authentik/managed/tasks.py @@ -20,5 +20,5 @@ def managed_reconcile(self: MonitoredTask): self.set_status( TaskResult(TaskResultStatus.SUCCESSFUL, ["Successfully updated managed models."]) ) - except DatabaseError as exc: + except DatabaseError as exc: # pragma: no cover self.set_status(TaskResult(TaskResultStatus.WARNING, [str(exc)])) diff --git a/authentik/managed/tests.py b/authentik/managed/tests.py new file mode 100644 index 000000000..85c859ffe --- /dev/null +++ b/authentik/managed/tests.py @@ -0,0 +1,13 @@ +"""managed tests""" +from django.test import TestCase + +from authentik.managed.tasks import managed_reconcile + + +class TestManaged(TestCase): + """managed tests""" + + def test_reconcile(self): + """Test reconcile""" + # pyright: reportGeneralTypeIssues=false + managed_reconcile() # pylint: disable=no-value-for-parameter