diff --git a/src/backend/mailbox_manager/tests/api/mail_domain_accesses/test_api_mail_domain_accesses_delete.py b/src/backend/mailbox_manager/tests/api/mail_domain_accesses/test_api_mail_domain_accesses_delete.py index bd5ba15f1..09a88146a 100644 --- a/src/backend/mailbox_manager/tests/api/mail_domain_accesses/test_api_mail_domain_accesses_delete.py +++ b/src/backend/mailbox_manager/tests/api/mail_domain_accesses/test_api_mail_domain_accesses_delete.py @@ -93,8 +93,7 @@ def test_api_mail_domain__accesses_delete_administrators(): def test_api_mail_domain__accesses_delete_owners(): """ - Users should be able to delete the mail_domain access of another user - for a mail_domain of which they are owner provided it is not an owner access. + An owner should be able to delete the mail domain access of another user including a owner access. """ authenticated_user = core_factories.UserFactory() mail_domain = factories.MailDomainFactory( @@ -127,7 +126,8 @@ def test_api_mail_domain__accesses_delete_owners_last_owner(): user=authenticated_user, role=enums.MailDomainRoleChoices.OWNER, ) - assert models.MailDomainAccess.objects.count() == 1 + factories.MailDomainAccessFactory.create_batch(9) + assert models.MailDomainAccess.objects.count() == 10 client = APIClient() client.force_login(authenticated_user) @@ -137,4 +137,4 @@ def test_api_mail_domain__accesses_delete_owners_last_owner(): ) assert response.status_code == status.HTTP_403_FORBIDDEN - assert models.MailDomainAccess.objects.count() == 1 + assert models.MailDomainAccess.objects.count() == 10