From a54ed0fd587150bb53a84d84d336254ad46924ad Mon Sep 17 00:00:00 2001 From: wlorenzetti Date: Tue, 26 Sep 2023 09:13:26 +0200 Subject: [PATCH] Fix test for layer acl QGIS server filter. --- g3w-admin/qdjango/tests/test_constraints.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/g3w-admin/qdjango/tests/test_constraints.py b/g3w-admin/qdjango/tests/test_constraints.py index 5d6deacf7..614cfc96e 100644 --- a/g3w-admin/qdjango/tests/test_constraints.py +++ b/g3w-admin/qdjango/tests/test_constraints.py @@ -1773,12 +1773,12 @@ def test_geoconstraint_filter(self): constraint.save() # assign permissions - assign_perm('view_project', self.test_viewer1, self.qdjango_project) - assign_perm('view_project', self.test_viewer1_3, self.qdjango_project) - assign_perm('view_project', self.test_gu_viewer1, self.qdjango_project) - # also to Anonymous user - assign_perm('view_project', get_anonymous_user(), self.qdjango_project) + for u in (self.test_viewer1, self.test_viewer1_3, self.test_gu_viewer1, get_anonymous_user()): + assign_perm('view_project', u, self.qdjango_project) + for l in self.qdjango_project.layer_set.all(): + assign_perm("view_layer", u, l) + ows_url = reverse('OWS:ows', kwargs={'group_slug': self.qdjango_project.group.slug, 'project_type': 'qdjango', 'project_id': self.qdjango_project.id})