MCPcopy
hub / github.com/django/django / test_bcc_not_in_headers

Method test_bcc_not_in_headers

tests/mail/tests.py:386–398  ·  view source on GitHub ↗

A bcc address should be in the recipients, but not in the (visible) message headers.

(self)

Source from the content-addressed store, hash-verified

384 self.assertEqual(message.get_all("Cc"), ["foo@example.com"])
385
386 def test_bcc_not_in_headers(self):
387 """
388 A bcc address should be in the recipients,
389 but not in the (visible) message headers.
390 """
391 email = EmailMessage(
392 to=["to@example.com"],
393 bcc=["bcc@example.com"],
394 )
395 message = email.message()
396 self.assertNotIn("Bcc", message)
397 self.assertNotIn("bcc@example.com", message.as_string())
398 self.assertEqual(email.recipients(), ["to@example.com", "bcc@example.com"])
399
400 def test_reply_to(self):
401 with self.subTest("Single Reply-To"):

Callers

nothing calls this directly

Calls 4

messageMethod · 0.95
recipientsMethod · 0.95
EmailMessageClass · 0.90
as_stringMethod · 0.45

Tested by

no test coverage detected