def test_sender_as_tuple(self): msg = Message(subject="testing", sender=("tester", "*****@*****.**"), body="test") msg_str = msg.dump() self.assertTrue("From: tester <*****@*****.**>" in str(msg_str))
def test_cc(self): msg = Message(subject="testing", recipients=["*****@*****.**"], body="testing", cc=["*****@*****.**"]) msg_str = msg.dump() self.assertTrue("Cc: [email protected]" in str(msg_str))
def test_reply_to(self): msg = Message(subject="testing", recipients=["*****@*****.**"], sender="spammer <*****@*****.**>", reply_to="somebody <*****@*****.**>", body="testing") msg_str = msg.dump() self.assertTrue("Reply-To: somebody <*****@*****.**>" in str(msg_str))
def test_reply_to(self): msg = Message(subject="testing", recipients=["*****@*****.**"], sender="spammer <*****@*****.**>", reply_to="somebody <*****@*****.**>", body="testing") msg_str = msg.dump() self.assertTrue( "Reply-To: somebody <*****@*****.**>" in str(msg_str))