Commit a45e5e8e authored by Michal Čihař's avatar Michal Čihař

Test denied owner removal

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent d64b0a6f
......@@ -147,3 +147,25 @@ class ACLViewTest(ViewTestCase):
username=self.second_user.username
).exists()
)
def test_denied_owner_delete(self):
"""Test that deleting last owner does not work."""
self.project.owners.add(self.user)
self.client.post(
reverse('revoke-owner', kwargs=self.kw_project),
{'name': self.second_user.username}
)
self.assertTrue(
self.project.owners.filter(
username=self.user.username
).exists()
)
self.client.post(
reverse('delete-user', kwargs=self.kw_project),
{'name': self.second_user.username}
)
self.assertTrue(
self.project.owners.filter(
username=self.user.username
).exists()
)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment