From 309725b4598f5b373cd5a35a78f65b6c2ca75750 Mon Sep 17 00:00:00 2001 From: Marie PUPO JEAMMET Date: Tue, 16 Jul 2024 18:06:26 +0200 Subject: [PATCH] =?UTF-8?q?fixup!=20=E2=9C=A8(mailboxes)=20add=20webhook?= =?UTF-8?q?=20to=20dimail-api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/mailbox_manager/models.py | 2 -- .../mailboxes/test_api_mailboxes_create.py | 20 ------------------- 2 files changed, 22 deletions(-) diff --git a/src/backend/mailbox_manager/models.py b/src/backend/mailbox_manager/models.py index ac02b0663..9a1f940d2 100644 --- a/src/backend/mailbox_manager/models.py +++ b/src/backend/mailbox_manager/models.py @@ -95,8 +95,6 @@ def get_headers(self): "This secret does not allow for a new token." ) - # import pdb; pdb.set_trace() - if "access_token" in response.json(): headers["Authorization"] = f"Bearer {response.json()['access_token']}" diff --git a/src/backend/mailbox_manager/tests/api/mailboxes/test_api_mailboxes_create.py b/src/backend/mailbox_manager/tests/api/mailboxes/test_api_mailboxes_create.py index 2f01c8719..3bdd58a02 100644 --- a/src/backend/mailbox_manager/tests/api/mailboxes/test_api_mailboxes_create.py +++ b/src/backend/mailbox_manager/tests/api/mailboxes/test_api_mailboxes_create.py @@ -31,26 +31,6 @@ def test_api_mailboxes__create_anonymous_forbidden(): assert not models.Mailbox.objects.exists() -def test_api_mailboxes__create_domain_does_not_exist(): - """ - Users should not be able to send requests to a non-existing domain. - """ - user = core_factories.UserFactory() - - client = APIClient() - client.force_login(user) - mailbox_data = serializers.MailboxSerializer(factories.MailboxFactory.build()).data - mailbox_data["domain"] = "nonexistent.domain" - - response = client.post( - "/api/v1.0/mail-domains/nonexistent.domain/mailboxes/", - mailbox_data, - format="json", - ) - assert response.status_code == status.HTTP_404_NOT_FOUND - assert response.json() == {"detail": "Not found."} - - def test_api_mailboxes__create_authenticated_missing_fields(): """ Authenticated users should not be able to create mailboxes