mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 03:41:05 -05:00
Brevo: add inbound support
(Also adds "responses" to test requirements, for mocking fetches of Brevo inbound attachments.) Closes #322
This commit is contained in:
@@ -4,6 +4,7 @@ from unittest.mock import ANY
|
||||
|
||||
from django.test import tag
|
||||
|
||||
from anymail.exceptions import AnymailConfigurationError
|
||||
from anymail.signals import AnymailTrackingEvent
|
||||
from anymail.webhooks.sendinblue import SendinBlueTrackingWebhookView
|
||||
|
||||
@@ -390,3 +391,15 @@ class SendinBlueDeliveryTestCase(WebhookTestCase):
|
||||
)
|
||||
event = kwargs["event"]
|
||||
self.assertEqual(event.event_type, "unsubscribed")
|
||||
|
||||
def test_misconfigured_inbound(self):
|
||||
errmsg = (
|
||||
"You seem to have set SendinBlue's *inbound* webhook URL"
|
||||
" to Anymail's SendinBlue *tracking* webhook URL."
|
||||
)
|
||||
with self.assertRaisesMessage(AnymailConfigurationError, errmsg):
|
||||
self.client.post(
|
||||
"/anymail/sendinblue/tracking/",
|
||||
content_type="application/json",
|
||||
data={"items": []},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user