Tests: use deliverable recipient addresses for live integration tests

Using undeliverable @example.com recipient addresses leads some ESPs
to flag the Anymail test accounts. Switch all live integration tests
to mailinator.com recipients (unless they were already using the ESP's
own "test sink" addresses).
This commit is contained in:
medmunds
2018-03-13 09:08:36 -07:00
parent 70f5e3e84c
commit 3874525fd0
5 changed files with 54 additions and 52 deletions

View File

@@ -33,7 +33,7 @@ class MandrillBackendIntegrationTests(SimpleTestCase, AnymailTestMixin):
def setUp(self):
super(MandrillBackendIntegrationTests, self).setUp()
self.message = mail.EmailMultiAlternatives('Anymail Mandrill integration test', 'Text content',
'from@example.com', ['to@example.com'])
'from@example.com', ['anymail-test-to1@mailinator.com'])
self.message.attach_alternative('<p>HTML content</p>', "text/html")
def test_simple_send(self):
@@ -43,8 +43,8 @@ class MandrillBackendIntegrationTests(SimpleTestCase, AnymailTestMixin):
# noinspection PyUnresolvedReferences
anymail_status = self.message.anymail_status
sent_status = anymail_status.recipients['to@example.com'].status
message_id = anymail_status.recipients['to@example.com'].message_id
sent_status = anymail_status.recipients['anymail-test-to1@mailinator.com'].status
message_id = anymail_status.recipients['anymail-test-to1@mailinator.com'].message_id
self.assertIn(sent_status, ['sent', 'queued']) # successful send (could still bounce later)
self.assertGreater(len(message_id), 0) # don't know what it'll be, but it should exist
@@ -54,12 +54,12 @@ class MandrillBackendIntegrationTests(SimpleTestCase, AnymailTestMixin):
def test_all_options(self):
message = AnymailMessage(
subject="Anymail all-options integration test",
subject="Anymail Mandrill all-options integration test",
body="This is the text body",
from_email="Test From <from@example.com>",
to=["to1@example.com", "Recipient 2 <to2@example.com>"],
cc=["cc1@example.com", "Copy 2 <cc2@example.com>"],
bcc=["bcc1@example.com", "Blind Copy 2 <bcc2@example.com>"],
to=["anymail-test-to1@mailinator.com", "Recipient 2 <anymail-test-to2@mailinator.com>"],
cc=["anymail-test-cc1@mailinator.com", "Copy 2 <anymail-test-cc2@mailinator.com>"],
bcc=["anymail-test-bcc1@mailinator.com", "Blind Copy 2 <anymail-test-bcc2@mailinator.com>"],
reply_to=["reply1@example.com", "Reply 2 <reply2@example.com>"],
headers={"X-Anymail-Test": "value"},