MCPcopy
hub / github.com/django/django / test_reply_to

Method test_reply_to

tests/mail/tests.py:400–423  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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"):
402 email = EmailMessage(
403 "Subject",
404 "Content",
405 "from@example.com",
406 ["to@example.com"],
407 reply_to=["reply_to@example.com"],
408 )
409 message = email.message()
410 self.assertEqual(message["Reply-To"], "reply_to@example.com")
411
412 with self.subTest("Multiple Reply-To"):
413 email = EmailMessage(
414 "Subject",
415 "Content",
416 "from@example.com",
417 ["to@example.com"],
418 reply_to=["reply_to1@example.com", "reply_to2@example.com"],
419 )
420 message = email.message()
421 self.assertEqual(
422 message["Reply-To"], "reply_to1@example.com, reply_to2@example.com"
423 )
424
425 def test_recipients_as_tuple(self):
426 email = EmailMessage(

Callers

nothing calls this directly

Calls 2

messageMethod · 0.95
EmailMessageClass · 0.90

Tested by

no test coverage detected