bifurqué depuis cliss21/benevalibre
feat(tests) : vérifie qu'un manager d'asso peut aussi manager les rôles
Parent
acf9762acb
révision
2a4d4f9b61
|
@ -78,3 +78,15 @@ class TestRoles:
|
|||
|
||||
with pytest.raises(ValidationError, match="ne possède l'attribut"):
|
||||
role.save()
|
||||
|
||||
def test_asso_manager_can_manage_roles(
|
||||
self, association, foreign, engagement
|
||||
):
|
||||
association.role_set.create(
|
||||
name="AssoManager", manage_association=True
|
||||
)
|
||||
association.engagement_set.create(
|
||||
user=foreign, role=association.role_set.get(name="AssoManager")
|
||||
)
|
||||
assert association.can_manage_association(foreign)
|
||||
assert association.can_manage_roles(foreign)
|
||||
|
|
Chargement…
Référencer dans un nouveau ticket