Commit eb34210c authored by Yusei Tahara's avatar Yusei Tahara

Update test, now notification tool supports html email without crm.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21480 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c52632b5
...@@ -551,10 +551,7 @@ Yes, I will go.""" ...@@ -551,10 +551,7 @@ Yes, I will go."""
# Check Message # Check Message
mail_dict = decode_email(messageText) mail_dict = decode_email(messageText)
self.assertEquals(mail_dict['headers']['subject'], 'Subject') self.assertEquals(mail_dict['headers']['subject'], 'Subject')
# self.assertEquals(mail_dict['body'], '<html><body>%s</body></html>' % message)
# Without CRM, it does not support HTML mail.
#
self.assertEquals(mail_dict['body'], 'Click Here!!')
self.assertSameSet([], mail_dict['attachment_list']) self.assertSameSet([], mail_dict['attachment_list'])
def test_12_HtmlMessage(self, quiet=quiet, run=run_all_test): def test_12_HtmlMessage(self, quiet=quiet, run=run_all_test):
...@@ -583,31 +580,6 @@ class TestNotificationToolWithCRM(TestNotificationTool): ...@@ -583,31 +580,6 @@ class TestNotificationToolWithCRM(TestNotificationTool):
def getBusinessTemplateList(self): def getBusinessTemplateList(self):
return ('erp5_base', 'erp5_crm') return ('erp5_base', 'erp5_crm')
def stepCheckNotificationHtmlFormat(self, sequence=None,
sequence_list=None, **kw):
"""
Check that if notification format is html.
"""
message = """<a href="http://www.erp5.com/">Click Here!!</a>"""
self.portal.portal_notifications.sendMessage(
recipient='userA', subject='Subject',
message_text_format='text/html', message=message)
last_message = self.portal.MailHost._last_message
self.assertNotEquals((), last_message)
mfrom, mto, messageText = last_message
self.assertEquals('site@example.invalid', mfrom)
self.assertEquals(['userA@example.invalid'], mto)
# Check Message
mail_dict = decode_email(messageText)
self.assertEquals(mail_dict['headers']['subject'], 'Subject')
#
# With CRM, it support HTML mail.
#
self.assertEquals(mail_dict['body'], '<html><body>%s</body></html>' % message)
self.assertSameSet([], mail_dict['attachment_list'])
def test_suite(): def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment