本文整理汇总了Python中pyramid_mailer.message.Message.get_response方法的典型用法代码示例。如果您正苦于以下问题:Python Message.get_response方法的具体用法?Python Message.get_response怎么用?Python Message.get_response使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyramid_mailer.message.Message
的用法示例。
在下文中一共展示了Message.get_response方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_cc_without_recipients_2
# 需要导入模块: from pyramid_mailer.message import Message [as 别名]
# 或者: from pyramid_mailer.message.Message import get_response [as 别名]
def test_cc_without_recipients_2(self):
from pyramid_mailer.message import Message
msg = Message(subject="testing", sender="[email protected]", body="testing", cc=["[email protected]"])
response = msg.get_response()
self.assertTrue("Cc: [email protected]" in str(response))
示例2: test_bcc
# 需要导入模块: from pyramid_mailer.message import Message [as 别名]
# 或者: from pyramid_mailer.message.Message import get_response [as 别名]
def test_bcc(self):
from pyramid_mailer.message import Message
msg = Message(
subject="testing", recipients=["[email protected]"], body="testing", bcc=["[email protected]"]
)
response = msg.get_response()
self.assert_("Bcc: [email protected]" in str(response))
示例3: test_bcc_without_recipients
# 需要导入模块: from pyramid_mailer.message import Message [as 别名]
# 或者: from pyramid_mailer.message.Message import get_response [as 别名]
def test_bcc_without_recipients(self):
from pyramid_mailer.message import Message
from pyramid_mailer.mailer import Mailer
msg = Message(subject="testing", sender="[email protected]", body="testing", bcc=["[email protected]"])
mailer = Mailer()
msgid = mailer.send(msg)
response = msg.get_response()
self.assertFalse("Bcc: [email protected]" in str(response))
self.assertTrue(msgid)
示例4: test_attach
# 需要导入模块: from pyramid_mailer.message import Message [as 别名]
# 或者: from pyramid_mailer.message.Message import get_response [as 别名]
def test_attach(self):
from pyramid_mailer.message import Message
from pyramid_mailer.message import Attachment
msg = Message(subject="testing", recipients=["[email protected]"], body="testing")
msg.attach(Attachment(data="this is a test", content_type="text/plain"))
a = msg.attachments[0]
self.assertTrue(a.filename is None)
self.assertEqual(a.disposition, "attachment")
self.assertEqual(a.content_type, "text/plain")
self.assertEqual(a.data, "this is a test")
response = msg.get_response()
self.assertEqual(len(response.attachments), 1)