forked from Github-Mirrors/canaille
tests: fix coverage
This commit is contained in:
parent
f113188368
commit
30bd71c5b5
2 changed files with 16 additions and 2 deletions
|
@ -100,8 +100,11 @@ class LDAPObjectQuery:
|
|||
|
||||
def guess_class(self, klass, object_classes):
|
||||
if klass == LDAPObject:
|
||||
for oc in object_classes:
|
||||
return LDAPObjectMetaclass.ldap_to_python_class[oc.decode()]
|
||||
models = [
|
||||
LDAPObjectMetaclass.ldap_to_python_class[oc.decode()]
|
||||
for oc in object_classes
|
||||
]
|
||||
return models[0]
|
||||
return klass
|
||||
|
||||
|
||||
|
|
|
@ -7,3 +7,14 @@ def test_group_permissions_by_dn(testclient, user, foo_group):
|
|||
user.reload()
|
||||
|
||||
assert user.can_manage_users
|
||||
|
||||
|
||||
def test_group_permissions_str(testclient, user, foo_group):
|
||||
assert not user.can_manage_users
|
||||
|
||||
testclient.app.config["CANAILLE"]["ACL"]["ADMIN"]["FILTER"] = (
|
||||
f"memberOf={foo_group.dn}"
|
||||
)
|
||||
user.reload()
|
||||
|
||||
assert user.can_manage_users
|
||||
|
|
Loading…
Reference in a new issue