From 766fed9767228014395d5a56c5ec5dbb14c067c9 Mon Sep 17 00:00:00 2001 From: Marcus Ahle Date: Thu, 26 Sep 2013 09:17:38 -0400 Subject: [PATCH] Adding test for sending html email --- tests/test_ses/test_ses.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/test_ses/test_ses.py b/tests/test_ses/test_ses.py index 4c0440c40..6b8f357df 100644 --- a/tests/test_ses/test_ses.py +++ b/tests/test_ses/test_ses.py @@ -54,7 +54,21 @@ def test_send_email(): send_quota = conn.get_send_quota() sent_count = int(send_quota['GetSendQuotaResponse']['GetSendQuotaResult']['SentLast24Hours']) sent_count.should.equal(1) + +@mock_ses +def test_send_html_email(): + conn = boto.connect_ses('the_key', 'the_secret') + conn.send_email.when.called_with( + "test@example.com", "test subject", + "test body", "test_to@example.com", format="html").should.throw(BotoServerError) + + conn.verify_email_identity("test@example.com") + conn.send_email("test@example.com", "test subject", "test body", "test_to@example.com", format="html") + + send_quota = conn.get_send_quota() + sent_count = int(send_quota['GetSendQuotaResponse']['GetSendQuotaResult']['SentLast24Hours']) + sent_count.should.equal(1) @mock_ses def test_send_raw_email():