diff --git a/anymail/backends/mailgun.py b/anymail/backends/mailgun.py index 5f8d933..6ba75da 100644 --- a/anymail/backends/mailgun.py +++ b/anymail/backends/mailgun.py @@ -1,7 +1,6 @@ -import warnings from datetime import datetime -from ..exceptions import AnymailRequestsAPIError, AnymailError, AnymailDeprecationWarning +from ..exceptions import AnymailRequestsAPIError, AnymailError from ..message import AnymailRecipientStatus from ..utils import get_anymail_setting, rfc2822date @@ -57,15 +56,6 @@ class EmailBackend(AnymailRequestsBackend): return {recipient.email: status for recipient in payload.all_recipients} -# Pre-v0.8 naming (deprecated) -class MailgunBackend(EmailBackend): - def __init__(self, **kwargs): - warnings.warn(AnymailDeprecationWarning( - "Please update your EMAIL_BACKEND setting to " - "'anymail.backends.mailgun.EmailBackend'")) - super(MailgunBackend, self).__init__(**kwargs) - - class MailgunPayload(RequestsPayload): def __init__(self, message, defaults, backend, *args, **kwargs): diff --git a/anymail/backends/mandrill.py b/anymail/backends/mandrill.py index d45bc7d..758e7c4 100644 --- a/anymail/backends/mandrill.py +++ b/anymail/backends/mandrill.py @@ -1,7 +1,7 @@ import warnings from datetime import datetime -from ..exceptions import AnymailRequestsAPIError, AnymailWarning, AnymailDeprecationWarning +from ..exceptions import AnymailRequestsAPIError, AnymailWarning from ..message import AnymailRecipientStatus, ANYMAIL_STATUSES from ..utils import last, combine, get_anymail_setting @@ -47,15 +47,6 @@ class EmailBackend(AnymailRequestsBackend): return recipient_status -# Pre-v0.8 naming (deprecated) -class MandrillBackend(EmailBackend): - def __init__(self, **kwargs): - warnings.warn(AnymailDeprecationWarning( - "Please update your EMAIL_BACKEND setting to " - "'anymail.backends.mandrill.EmailBackend'")) - super(MandrillBackend, self).__init__(**kwargs) - - class DjrillDeprecationWarning(AnymailWarning, DeprecationWarning): """Warning for features carried over from Djrill that will be removed soon""" diff --git a/anymail/backends/postmark.py b/anymail/backends/postmark.py index 22b9795..a144e9a 100644 --- a/anymail/backends/postmark.py +++ b/anymail/backends/postmark.py @@ -1,9 +1,8 @@ import re -import warnings from requests.structures import CaseInsensitiveDict -from ..exceptions import AnymailRequestsAPIError, AnymailDeprecationWarning +from ..exceptions import AnymailRequestsAPIError from ..message import AnymailRecipientStatus from ..utils import get_anymail_setting @@ -95,15 +94,6 @@ class EmailBackend(AnymailRequestsBackend): return [] -# Pre-v0.8 naming (deprecated) -class PostmarkBackend(EmailBackend): - def __init__(self, **kwargs): - warnings.warn(AnymailDeprecationWarning( - "Please update your EMAIL_BACKEND setting to " - "'anymail.backends.postmark.EmailBackend'")) - super(PostmarkBackend, self).__init__(**kwargs) - - class PostmarkPayload(RequestsPayload): def __init__(self, message, defaults, backend, *args, **kwargs): diff --git a/anymail/backends/sendgrid.py b/anymail/backends/sendgrid.py index afe6a16..d345e81 100644 --- a/anymail/backends/sendgrid.py +++ b/anymail/backends/sendgrid.py @@ -5,7 +5,7 @@ from django.core.mail import make_msgid from requests.structures import CaseInsensitiveDict from .base_requests import AnymailRequestsBackend, RequestsPayload -from ..exceptions import AnymailConfigurationError, AnymailRequestsAPIError, AnymailWarning, AnymailDeprecationWarning +from ..exceptions import AnymailConfigurationError, AnymailRequestsAPIError, AnymailWarning from ..message import AnymailRecipientStatus from ..utils import get_anymail_setting, timestamp, update_deep, parse_address_list @@ -67,15 +67,6 @@ class EmailBackend(AnymailRequestsBackend): return {recipient.email: status for recipient in payload.all_recipients} -# Pre-v0.8 naming (deprecated) -class SendGridBackend(EmailBackend): - def __init__(self, **kwargs): - warnings.warn(AnymailDeprecationWarning( - "Please update your EMAIL_BACKEND setting to " - "'anymail.backends.sendgrid.EmailBackend'")) - super(SendGridBackend, self).__init__(**kwargs) - - class SendGridPayload(RequestsPayload): def __init__(self, message, defaults, backend, *args, **kwargs): diff --git a/anymail/backends/sparkpost.py b/anymail/backends/sparkpost.py index b3976b7..20e652e 100644 --- a/anymail/backends/sparkpost.py +++ b/anymail/backends/sparkpost.py @@ -1,10 +1,7 @@ from __future__ import absolute_import # we want the sparkpost package, not our own module -import warnings - from .base import AnymailBaseBackend, BasePayload -from ..exceptions import (AnymailAPIError, AnymailImproperlyInstalled, - AnymailConfigurationError, AnymailDeprecationWarning) +from ..exceptions import AnymailAPIError, AnymailImproperlyInstalled, AnymailConfigurationError from ..message import AnymailRecipientStatus from ..utils import get_anymail_setting @@ -82,15 +79,6 @@ class EmailBackend(AnymailBaseBackend): return {recipient.email: recipient_status for recipient in payload.all_recipients} -# Pre-v0.8 naming (deprecated) -class SparkPostBackend(EmailBackend): - def __init__(self, **kwargs): - warnings.warn(AnymailDeprecationWarning( - "Please update your EMAIL_BACKEND setting to " - "'anymail.backends.sparkpost.EmailBackend'")) - super(SparkPostBackend, self).__init__(**kwargs) - - class SparkPostPayload(BasePayload): def init_payload(self): self.params = {} diff --git a/tests/test_mailgun_backend.py b/tests/test_mailgun_backend.py index 54e9bab..07997aa 100644 --- a/tests/test_mailgun_backend.py +++ b/tests/test_mailgun_backend.py @@ -538,12 +538,3 @@ class MailgunBackendImproperlyConfiguredTests(SimpleTestCase, AnymailTestMixin): # Make sure the error mentions MAILGUN_API_KEY and ANYMAIL_MAILGUN_API_KEY self.assertRegex(errmsg, r'\bMAILGUN_API_KEY\b') self.assertRegex(errmsg, r'\bANYMAIL_MAILGUN_API_KEY\b') - - -class MailgunBackendDeprecationTests(MailgunBackendMockAPITestCase): - @override_settings(EMAIL_BACKEND='anymail.backends.mailgun.MailgunBackend') - def test_renamed_backend_warning(self): - # ...mailgun.MailgunBackend --> ...mailgun.EmailBackend - with self.assertWarnsRegex(DeprecationWarning, - r'anymail\.backends\.mailgun\.EmailBackend'): - self.message.send() diff --git a/tests/test_mandrill_backend.py b/tests/test_mandrill_backend.py index f322145..bc86bd3 100644 --- a/tests/test_mandrill_backend.py +++ b/tests/test_mandrill_backend.py @@ -597,12 +597,3 @@ class MandrillBackendImproperlyConfiguredTests(SimpleTestCase, AnymailTestMixin) errmsg = str(cm.exception) self.assertRegex(errmsg, r'\bMANDRILL_API_KEY\b') self.assertRegex(errmsg, r'\bANYMAIL_MANDRILL_API_KEY\b') - - -class MandrillBackendDeprecationTests(MandrillBackendMockAPITestCase): - @override_settings(EMAIL_BACKEND='anymail.backends.mandrill.MandrillBackend') - def test_renamed_backend_warning(self): - # ...mandrill.MandrillBackend --> ...mandrill.EmailBackend - with self.assertWarnsRegex(DeprecationWarning, - r'anymail\.backends\.mandrill\.EmailBackend'): - self.message.send() diff --git a/tests/test_postmark_backend.py b/tests/test_postmark_backend.py index 27153fc..4d459de 100644 --- a/tests/test_postmark_backend.py +++ b/tests/test_postmark_backend.py @@ -584,12 +584,3 @@ class PostmarkBackendImproperlyConfiguredTests(SimpleTestCase, AnymailTestMixin) errmsg = str(cm.exception) self.assertRegex(errmsg, r'\bPOSTMARK_SERVER_TOKEN\b') self.assertRegex(errmsg, r'\bANYMAIL_POSTMARK_SERVER_TOKEN\b') - - -class PostmarkBackendDeprecationTests(PostmarkBackendMockAPITestCase): - @override_settings(EMAIL_BACKEND='anymail.backends.postmark.PostmarkBackend') - def test_renamed_backend_warning(self): - # ...postmark.PostmarkBackend --> ...postmark.EmailBackend - with self.assertWarnsRegex(DeprecationWarning, - r'anymail\.backends\.postmark\.EmailBackend'): - self.message.send() diff --git a/tests/test_sendgrid_backend.py b/tests/test_sendgrid_backend.py index 0c42ef2..731380d 100644 --- a/tests/test_sendgrid_backend.py +++ b/tests/test_sendgrid_backend.py @@ -644,12 +644,3 @@ class SendGridBackendDisallowsV2Tests(SimpleTestCase, AnymailTestMixin): message.esp_extra = {'x-smtpapi': {'asm_group_id': 1}} with self.assertRaisesRegex(AnymailConfigurationError, r'\bsendgrid_v2\.EmailBackend\b'): message.send() - - -class SendGridBackendDeprecationTests(SendGridBackendMockAPITestCase): - @override_settings(EMAIL_BACKEND='anymail.backends.sendgrid.SendGridBackend') - def test_renamed_backend_warning(self): - # ...sendgrid.SendGridBackend --> ...sendgrid.EmailBackend - with self.assertWarnsRegex(DeprecationWarning, - r'anymail\.backends\.sendgrid\.EmailBackend'): - self.message.send() diff --git a/tests/test_sparkpost_backend.py b/tests/test_sparkpost_backend.py index 4a70075..11b8738 100644 --- a/tests/test_sparkpost_backend.py +++ b/tests/test_sparkpost_backend.py @@ -600,12 +600,3 @@ class SparkPostBackendImproperlyConfiguredTests(SimpleTestCase, AnymailTestMixin # Poke into implementation details to verify: self.assertIsNone(conn.api_key) # Anymail prop self.assertEqual(conn.sp.api_key, 'key_from_environment') # SparkPost prop - - -class SparkPostBackendDeprecationTests(SparkPostBackendMockAPITestCase): - @override_settings(EMAIL_BACKEND='anymail.backends.sparkpost.SparkPostBackend') - def test_renamed_backend_warning(self): - # ...sparkpost.SparkPostBackend --> ...sparkpost.EmailBackend - with self.assertWarnsRegex(DeprecationWarning, - r'anymail\.backends\.sparkpost\.EmailBackend'): - self.message.send()