mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 11:51:05 -05:00
Sendinblue: fix "invalid headers" error
Work around recent (unannounced) Sendinblue API change that caused "Invalid headers" API error with non-string custom header values, by converting basic numeric types to strings. (Borrowed code from SendGrid backend.) Fixes #288
This commit is contained in:
@@ -118,7 +118,8 @@ class SendinBlueBackendStandardEmailTests(SendinBlueBackendMockAPITestCase):
|
||||
self.message.send()
|
||||
data = self.get_api_call_json()
|
||||
self.assertEqual(data['headers']['X-Custom'], 'string')
|
||||
self.assertEqual(data['headers']['X-Num'], 123)
|
||||
# Header values must be strings (changed 11/2022)
|
||||
self.assertEqual(data['headers']['X-Num'], "123")
|
||||
# Reply-To must be moved to separate param
|
||||
self.assertNotIn('Reply-To', data['headers'])
|
||||
self.assertEqual(data['replyTo'], {'name': "Do Not Reply", 'email': "noreply@example.com"})
|
||||
|
||||
Reference in New Issue
Block a user