diff --git a/backend/tests/content/test_ct_secretaria.py b/backend/tests/content/test_ct_secretaria.py index 387315a..74fa5c9 100644 --- a/backend/tests/content/test_ct_secretaria.py +++ b/backend/tests/content/test_ct_secretaria.py @@ -80,3 +80,24 @@ def test_create(self, secretaria_payload, role, allowed): content = api.content.create( container=self.portal, **secretaria_payload ) + + @pytest.mark.parametrize( + "role", + [ + ["Manager"], + ["Site Administrator"], + ["Member"], + ["Editor"], + ], + ) + def test_cant_create(self, secretaria_payload, role): + usr = api.user.get_current() + with api.env.adopt_roles("Manager"): + content = api.content.create(container=self.portal, **secretaria_payload) + with api.env.adopt_roles(role): + assert ( + api.user.has_permission( + "portal.governo: Add Secretaria", user=usr, obj=content + ) + is False + )