From 4743e72e18296a5117de92486c584595623e087f Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Tue, 5 Jan 2021 12:37:52 +0100 Subject: [PATCH] policies: ensure binding has a target during unittests --- authentik/policies/tests/test_process.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/authentik/policies/tests/test_process.py b/authentik/policies/tests/test_process.py index 1b06e6f06..af46e757b 100644 --- a/authentik/policies/tests/test_process.py +++ b/authentik/policies/tests/test_process.py @@ -2,7 +2,7 @@ from django.core.cache import cache from django.test import TestCase -from authentik.core.models import User +from authentik.core.models import Application, User from authentik.events.models import Event, EventAction from authentik.policies.dummy.models import DummyPolicy from authentik.policies.expression.models import ExpressionPolicy @@ -75,7 +75,9 @@ class TestPolicyProcess(TestCase): policy = DummyPolicy.objects.create( result=False, wait_min=0, wait_max=1, execution_logging=True ) - binding = PolicyBinding(policy=policy) + binding = PolicyBinding( + policy=policy, target=Application.objects.create(name="test") + ) request = PolicyRequest(self.user) response = PolicyProcess(binding, request, None).execute()