當前位置: 首頁>>代碼示例>>Python>>正文


Python Suspect.tags['nobounce']方法代碼示例

本文整理匯總了Python中fuglu.shared.Suspect.tags['nobounce']方法的典型用法代碼示例。如果您正苦於以下問題:Python Suspect.tags['nobounce']方法的具體用法?Python Suspect.tags['nobounce']怎麽用?Python Suspect.tags['nobounce']使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在fuglu.shared.Suspect的用法示例。


在下文中一共展示了Suspect.tags['nobounce']方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_generated_message

# 需要導入模塊: from fuglu.shared import Suspect [as 別名]
# 或者: from fuglu.shared.Suspect import tags['nobounce'] [as 別名]
    def test_generated_message(self):
        from fuglu.shared import Suspect
        suspect = Suspect(
            u'[email protected]', '[email protected]', '/dev/null')
        suspect.tags['nobounce'] = True

        v = Vacation()
        v.ignoresender = u""
        v.awayuser = u'[email protected]'
        v.created = datetime.now()
        v.start = datetime.now()
        v.end = v.start + timedelta(days=2)
        v.subject = u'Döner mit schärf!'
        v.body = u"""Je m'envole pour l'Allemagne, où je suis né."""
        # v.body="Away!"
        self.session.add(v)
        self.session.flush()
        self.session.expunge_all()
        self.refreshcache()

        candidatevacation = self.candidate.on_vacation(suspect)
        self.assertTrue(
            candidatevacation != None, "Vacation object not found in database")

        message = self.candidate.send_vacation_reply(
            suspect, candidatevacation)
開發者ID:Caomhin,項目名稱:fuglu,代碼行數:28,代碼來源:plugins_vacation_test.py

示例2: test_template

# 需要導入模塊: from fuglu.shared import Suspect [as 別名]
# 或者: from fuglu.shared.Suspect import tags['nobounce'] [as 別名]
    def test_template(self):
        """Test Basic Template function"""

        suspect = Suspect('[email protected]',
                          '[email protected]', TESTDATADIR + '/helloworld.eml')
        suspect.tags['nobounce'] = True

        reason = "a three-headed monkey stole it"

        template = """Your message '${subject}' from ${from_address} to ${to_address} could not be delivered because ${reason}"""

        result = apply_template(template, suspect, dict(reason=reason))
        expected = """Your message 'Hello world!' from [email protected] to [email protected] could not be delivered because a three-headed monkey stole it"""
        self.assertEqual(
            result, expected), "Got unexpected template result: %s" % result
開發者ID:steigr,項目名稱:fuglu,代碼行數:17,代碼來源:shared_test.py


注:本文中的fuglu.shared.Suspect.tags['nobounce']方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。