Mailgun: add AMPHTML support

This commit is contained in:
medmunds
2021-01-26 18:08:39 -08:00
committed by Mike Edmunds
parent d33c9ea4ed
commit d1ef61d3ba
4 changed files with 30 additions and 0 deletions

View File

@@ -301,6 +301,15 @@ class MailgunBackendStandardEmailTests(MailgunBackendMockAPITestCase):
with self.assertRaises(AnymailUnsupportedFeature):
self.message.send()
def test_amp_html_alternative(self):
# Mailgun *does* support text/x-amp-html alongside text/html
self.message.attach_alternative("<p>HTML</p>", "text/html")
self.message.attach_alternative("<p>And AMP HTML</p>", "text/x-amp-html")
self.message.send()
data = self.get_api_call_data()
self.assertEqual(data["html"], "<p>HTML</p>")
self.assertEqual(data["amp-html"], "<p>And AMP HTML</p>")
def test_alternatives_fail_silently(self):
# Make sure fail_silently is respected
self.message.attach_alternative("{'not': 'allowed'}", "application/json")