-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into move-setup-to-pyproject
- Loading branch information
Showing
7 changed files
with
55 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "1.2.3" | ||
__version__ = "1.2.4" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,6 @@ | |
Header, | ||
MailSettings, | ||
Personalization, | ||
SpamCheck, | ||
Substitution, | ||
TrackingSettings, | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ class TestPostToSendgrid(SimpleTestCase): | |
) | ||
def test_post(self): | ||
""" | ||
Sends a POST to sendgrid's live API using a private API key that is stored | ||
Sends a POST to SendGrid's live API using a private API key that is stored | ||
in github. | ||
""" | ||
|
||
|
@@ -35,3 +35,34 @@ def test_post(self): | |
) | ||
val = msg.send() | ||
self.assertEqual(val, 1) | ||
|
||
# TESTING_SENDGRID_EU_API_KEY is only used for testing. | ||
@pytest.mark.skipif( | ||
not os.environ.get("TESTING_SENDGRID_EU_API_KEY"), | ||
reason="requires TESTING_SENDGRID_EU_API_KEY env var", | ||
) | ||
def test_eu_post(self): | ||
""" | ||
Sends a POST to SendGrid's live EU API using a private API key that is stored | ||
in GitHub. | ||
""" | ||
|
||
SENDGRID_API_KEY = os.environ.get("TESTING_SENDGRID_EU_API_KEY") | ||
|
||
# Set DEBUG=True so sandbox mode is enabled | ||
settings = { | ||
"DEBUG": True, | ||
"SENDGRID_API_KEY": SENDGRID_API_KEY, | ||
"SENDGRID_HOST_URL": "https://api.eu.sendgrid.com", | ||
"EMAIL_BACKEND": "sendgrid_backend.SendgridBackend", | ||
} | ||
|
||
with override_settings(**settings): | ||
msg = EmailMessage( | ||
subject="Hello, World!", | ||
body="Hello, World!", | ||
from_email="Sam Smith <[email protected]>", | ||
to=["John Doe <[email protected]>"], | ||
) | ||
val = msg.send() | ||
self.assertEqual(val, 1) |