Commit 62c4ba67 authored by Jérome Perrin's avatar Jérome Perrin

forge py3

parent ba4d4deb
...@@ -69,7 +69,7 @@ for to_url in to_url_list: ...@@ -69,7 +69,7 @@ for to_url in to_url_list:
multipart.add_file(data=attachment_dict['content'], multipart.add_file(data=attachment_dict['content'],
content_type=attachment_dict['mime_type'], content_type=attachment_dict['mime_type'],
filename=attachment_dict['name']) filename=attachment_dict['name'])
mail_message = str(multipart) mail_message = bytes(multipart)
# Bug Message not send email it self. # Bug Message not send email it self.
#context.activate(activity='SQLQueue').sendMailHostMessage(mail_message) #context.activate(activity='SQLQueue').sendMailHostMessage(mail_message)
......
...@@ -218,7 +218,7 @@ class TestBug(ERP5TypeTestCase): ...@@ -218,7 +218,7 @@ class TestBug(ERP5TypeTestCase):
mfrom, mto, messageText = last_message mfrom, mto, messageText = last_message
self.assertEqual('dummy <loggedperson@localhost>', mfrom) self.assertEqual('dummy <loggedperson@localhost>', mfrom)
self.assertEqual(['person1@localhost'], mto) self.assertEqual(['person1@localhost'], mto)
message = message_from_string(messageText) message = message_from_string(messageText.decode())
self.assertTrue(decode_header(message['Subject'])[0][0].endswith(bug.getTitle())) self.assertTrue(decode_header(message['Subject'])[0][0].endswith(bug.getTitle()))
def stepCheckBugMessageNotification(self, sequence=None, def stepCheckBugMessageNotification(self, sequence=None,
...@@ -232,7 +232,7 @@ class TestBug(ERP5TypeTestCase): ...@@ -232,7 +232,7 @@ class TestBug(ERP5TypeTestCase):
mfrom, mto, messageText = last_message mfrom, mto, messageText = last_message
self.assertEqual('person2@localhost', mfrom) self.assertEqual('person2@localhost', mfrom)
self.assertEqual(['person1@localhost'], mto) self.assertEqual(['person1@localhost'], mto)
message = message_from_string(messageText) message = message_from_string(messageText.decode())
self.assertTrue(decode_header(message['Subject'])[0][0].endswith(bug.getTitle())) self.assertTrue(decode_header(message['Subject'])[0][0].endswith(bug.getTitle()))
def stepSetSourceProject(self, sequence=None, sequence_list=None, **kw): def stepSetSourceProject(self, sequence=None, sequence_list=None, **kw):
...@@ -315,8 +315,8 @@ class TestBug(ERP5TypeTestCase): ...@@ -315,8 +315,8 @@ class TestBug(ERP5TypeTestCase):
_, _, messageText = last_message _, _, messageText = last_message
from email.parser import Parser from email.parser import Parser
p = Parser() p = Parser()
m = p.parsestr(messageText) m = p.parsestr(messageText.decode())
self.assertIn('Re-assign!', m.get_payload()[0].get_payload(decode=True)) self.assertIn(b'Re-assign!', m.get_payload()[0].get_payload(decode=True))
def stepCheckBugInit(self, sequence=None, sequence_list=None, **kw): def stepCheckBugInit(self, sequence=None, sequence_list=None, **kw):
......
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