MCPcopy
hub / github.com/django/django / test_plaintext_send_mail

Method test_plaintext_send_mail

tests/mail/tests.py:1955–1967  ·  view source on GitHub ↗

Test send_mail without the html_message regression test for adding html_message parameter to send_mail()

(self)

Source from the content-addressed store, hash-verified

1953 self.assertEqual(mail.outbox[0].sent_using, "default")
1954
1955 def test_plaintext_send_mail(self):
1956 """
1957 Test send_mail without the html_message
1958 regression test for adding html_message parameter to send_mail()
1959 """
1960 send_mail("Subject", "Content\n", "sender@example.com", ["nobody@example.com"])
1961 message = self.get_outbox_message()
1962
1963 self.assertEqual(message.get("subject"), "Subject")
1964 self.assertEqual(message.get_all("to"), ["nobody@example.com"])
1965 self.assertFalse(message.is_multipart())
1966 self.assertEqual(message.get_content(), "Content\n")
1967 self.assertEqual(message.get_content_type(), "text/plain")
1968
1969 def test_html_send_mail(self):
1970 """Test html_message argument to send_mail"""

Callers

nothing calls this directly

Calls 5

send_mailFunction · 0.90
get_outbox_messageMethod · 0.80
getMethod · 0.45
is_multipartMethod · 0.45
get_content_typeMethod · 0.45

Tested by

no test coverage detected