Skip to content

Commit

Permalink
Add seperate TESTING_SENDGRID_EU_API_KEY for testing EU sub accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemanger committed Nov 25, 2024
1 parent d8453b6 commit 0ec25b3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/test_post_to_sendgrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,18 @@ 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("SENDGRID_API_KEY"),
reason="requires SENDGRID_API_KEY env var",
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("SENDGRID_API_KEY")
SENDGRID_API_KEY = os.environ.get("TESTING_SENDGRID_EU_API_KEY")

# Set DEBUG=True so sandbox mode is enabled
settings = {
Expand Down

0 comments on commit 0ec25b3

Please sign in to comment.