From 88ce93ab0454fd3f21b40edfed5a5a0e7f841194 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 1 Mar 2021 19:22:35 +0100 Subject: [PATCH] policies: fix tests creating policies with empty names --- authentik/policies/tests/test_process.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/authentik/policies/tests/test_process.py b/authentik/policies/tests/test_process.py index 9c6505618..f1e913639 100644 --- a/authentik/policies/tests/test_process.py +++ b/authentik/policies/tests/test_process.py @@ -111,7 +111,7 @@ class TestPolicyProcess(TestCase): def test_exception(self): """Test policy execution""" - policy = Policy.objects.create() + policy = Policy.objects.create(name="test-execution") binding = PolicyBinding( policy=policy, target=Application.objects.create(name="test") ) @@ -123,7 +123,11 @@ class TestPolicyProcess(TestCase): def test_execution_logging(self): """Test policy execution creates event""" policy = DummyPolicy.objects.create( - result=False, wait_min=0, wait_max=1, execution_logging=True + name="test-execution-logging", + result=False, + wait_min=0, + wait_max=1, + execution_logging=True, ) binding = PolicyBinding( policy=policy, target=Application.objects.create(name="test") @@ -153,7 +157,11 @@ class TestPolicyProcess(TestCase): def test_execution_logging_anonymous(self): """Test policy execution creates event with anonymous user""" policy = DummyPolicy.objects.create( - result=False, wait_min=0, wait_max=1, execution_logging=True + name="test-execution-logging-anon", + result=False, + wait_min=0, + wait_max=1, + execution_logging=True, ) binding = PolicyBinding( policy=policy, target=Application.objects.create(name="test")