From 2a96da5aaa6441ef7769de51320f41be0661a6f0 Mon Sep 17 00:00:00 2001
From: Sylvain Le Bon <sylvain@startinblox.com>
Date: Thu, 5 Oct 2023 19:40:20 +0200
Subject: [PATCH] bugfix: added missing permission check on test model

---
 djangoldp_account/tests/models.py              | 3 ++-
 djangoldp_account/tests/tests_auth_backends.py | 5 +----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/djangoldp_account/tests/models.py b/djangoldp_account/tests/models.py
index c823d4b..3969d56 100644
--- a/djangoldp_account/tests/models.py
+++ b/djangoldp_account/tests/models.py
@@ -1,6 +1,6 @@
-from django.conf import settings
 from django.db import models
 from djangoldp.models import Model
+from djangoldp.permissions import AuthenticatedOnly, OwnerPermissions
 from djangoldp_account.models import LDPUser
 
 
@@ -12,5 +12,6 @@ class OwnedResource(Model):
 
     class Meta(Model.Meta):
         owner_field = 'user'
+        permission_classes = [AuthenticatedOnly, OwnerPermissions]
         serializer_fields = ['@id', 'description', 'user']
         depth = 1
diff --git a/djangoldp_account/tests/tests_auth_backends.py b/djangoldp_account/tests/tests_auth_backends.py
index a36ca4f..3272f5b 100644
--- a/djangoldp_account/tests/tests_auth_backends.py
+++ b/djangoldp_account/tests/tests_auth_backends.py
@@ -3,10 +3,7 @@ import uuid
 from urllib.parse import urlencode
 from jwkest.jwk import KEYS
 
-try:
-    from django.urls import reverse
-except ImportError:
-    from django.core.urlresolvers import reverse
+from django.urls import reverse
 from django.test import RequestFactory
 from django.core.management import call_command
 
-- 
GitLab