managed: add tests

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-11-15 19:53:08 +01:00
parent 357bd65028
commit d5341c2284
2 changed files with 14 additions and 1 deletions

View File

@ -20,5 +20,5 @@ def managed_reconcile(self: MonitoredTask):
self.set_status( self.set_status(
TaskResult(TaskResultStatus.SUCCESSFUL, ["Successfully updated managed models."]) 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)])) self.set_status(TaskResult(TaskResultStatus.WARNING, [str(exc)]))

View File

@ -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