Commit 10e2106c authored by Jérome Perrin's avatar Jérome Perrin

fixup! testInterfacePost: compare message by parse and dump to ignore line-wrap differences.

parent 09854271
...@@ -24,10 +24,13 @@ ...@@ -24,10 +24,13 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# #
############################################################################## ##############################################################################
import email
import mock import mock
import time import time
import six
if six.PY3:
from email import message_from_bytes
else:
from email import message_from_string as message_from_bytes
from Products.ERP5Type.tests.ERP5TypeLiveTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeLiveTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.Sequence import SequenceList from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ZSQLCatalog.SQLCatalog import SimpleQuery from Products.ZSQLCatalog.SQLCatalog import SimpleQuery
...@@ -248,8 +251,8 @@ class TestInterfacePost(ERP5TypeTestCase): ...@@ -248,8 +251,8 @@ class TestInterfacePost(ERP5TypeTestCase):
self.assertNotEqual((), last_message) self.assertNotEqual((), last_message)
_, _, message_text = last_message _, _, message_text = last_message
self.assertEqual( self.assertEqual(
bytes(email.message_from_bytes(message_text)), bytes(message_from_bytes(message_text)),
bytes(email.message_from_bytes(sequence['internet_message_post'].getData())), bytes(message_from_bytes(sequence['internet_message_post'].getData())),
) )
def _getMailHostMessageForRecipient(self, recipient_email_address): def _getMailHostMessageForRecipient(self, recipient_email_address):
...@@ -272,8 +275,8 @@ class TestInterfacePost(ERP5TypeTestCase): ...@@ -272,8 +275,8 @@ class TestInterfacePost(ERP5TypeTestCase):
message = message_list[0] message = message_list[0]
_, _, message_text = message _, _, message_text = message
self.assertEqual( self.assertEqual(
bytes(email.message_from_bytes(message_text)), bytes(message_from_bytes(message_text)),
bytes(email.message_from_bytes(post.getData())), bytes(message_from_bytes(post.getData())),
) )
def stepCheckMailMessagePreviewDisplaysLatestInternetMessagePostData(self, sequence=None, sequence_list=None): def stepCheckMailMessagePreviewDisplaysLatestInternetMessagePostData(self, sequence=None, sequence_list=None):
......
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