mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 03:41:05 -05:00
SendGrid: update to new v3 send API (#50)
SendGrid: update to v3 send API **SendGrid:** **[possibly-breaking]** Update SendGrid backend to newer Web API v3. This should be a transparent change for most projects. Exceptions: if you use SendGrid username/password auth, esp_extra with "x-smtpapi", or multiple Reply-To addresses, please review the [porting notes](http://anymail.readthedocs.io/en/latest/esps/sendgrid/#sendgrid-v3-upgrade). Closes #28
This commit is contained in:
@@ -81,12 +81,12 @@ class BackendSettingsTests(SimpleTestCase, AnymailTestMixin): # (so not
|
||||
def test_username_password_kwargs_overrides(self):
|
||||
"""Overrides for 'username' and 'password' should work like other overrides"""
|
||||
# These are special-cased because of default args in Django core mail functions.
|
||||
# (Use the SendGrid backend, which has settings named 'username' and 'password'.)
|
||||
backend = get_connection('anymail.backends.sendgrid.SendGridBackend')
|
||||
# (Use the SendGrid v2 backend, which has settings named 'username' and 'password'.)
|
||||
backend = get_connection('anymail.backends.sendgrid_v2.EmailBackend')
|
||||
self.assertEqual(backend.username, 'username_from_settings')
|
||||
self.assertEqual(backend.password, 'password_from_settings')
|
||||
|
||||
backend = get_connection('anymail.backends.sendgrid.SendGridBackend',
|
||||
backend = get_connection('anymail.backends.sendgrid_v2.EmailBackend',
|
||||
username='username_from_kwargs', password='password_from_kwargs')
|
||||
self.assertEqual(backend.username, 'username_from_kwargs')
|
||||
self.assertEqual(backend.password, 'password_from_kwargs')
|
||||
|
||||
Reference in New Issue
Block a user