Commit 8e37b000 authored by Jérome Perrin's avatar Jérome Perrin

testDeferredStyle: py3

parent 0ba6a109
...@@ -321,7 +321,7 @@ class TestDeferredStyleBase(DeferredStyleTestCase): ...@@ -321,7 +321,7 @@ class TestDeferredStyleBase(DeferredStyleTestCase):
# content is translated # content is translated
part, = [x for x in mail_message.walk() if x.get_content_type() == self.content_type] part, = [x for x in mail_message.walk() if x.get_content_type() == self.content_type]
self.assertIn( self.assertIn(
'Historique', b'Historique',
self.portal.portal_transforms.convertTo( self.portal.portal_transforms.convertTo(
'text/plain', 'text/plain',
part.get_payload(decode=True), part.get_payload(decode=True),
...@@ -352,7 +352,7 @@ class TestDeferredStyleBase(DeferredStyleTestCase): ...@@ -352,7 +352,7 @@ class TestDeferredStyleBase(DeferredStyleTestCase):
mail_message = email.message_from_string(self.portal.MailHost._last_message[2].decode()) mail_message = email.message_from_string(self.portal.MailHost._last_message[2].decode())
part, = [x for x in mail_message.walk() if x.get_content_type() == self.content_type] part, = [x for x in mail_message.walk() if x.get_content_type() == self.content_type]
self.assertIn( self.assertIn(
'Historique', b'Historique',
self.portal.portal_transforms.convertTo( self.portal.portal_transforms.convertTo(
'text/plain', 'text/plain',
part.get_payload(decode=True), part.get_payload(decode=True),
...@@ -386,7 +386,7 @@ class TestDeferredStyleBase(DeferredStyleTestCase): ...@@ -386,7 +386,7 @@ class TestDeferredStyleBase(DeferredStyleTestCase):
# after they are saved to DB and automatically migrated. The getProperty # after they are saved to DB and automatically migrated. The getProperty
# above, which is also what ods_style does, only work after the report # above, which is also what ods_style does, only work after the report
# state is updated. # state is updated.
report.__setstate__(aq_base(getattr(skin_folder, report_form_name)).__getstate__()) aq_base(report).__setstate__(aq_base(getattr(skin_folder, report_form_name)).__getstate__())
self.assertEqual(report.getProperty('title'), self.id()) self.assertEqual(report.getProperty('title'), self.id())
# Report section method # Report section method
...@@ -456,7 +456,7 @@ class TestDeferredStyleBase(DeferredStyleTestCase): ...@@ -456,7 +456,7 @@ class TestDeferredStyleBase(DeferredStyleTestCase):
'text/plain', 'text/plain',
part.get_payload(decode=True), part.get_payload(decode=True),
context=self.portal, context=self.portal,
mimetype=self.content_type).getData() mimetype=self.content_type).getData().decode()
self.assertIn( self.assertIn(
'in_list_method: set_in_dialog_request == set_in_dialog_request, set_in_report_method == set_in_report_method', 'in_list_method: set_in_dialog_request == set_in_dialog_request, set_in_report_method == set_in_report_method',
report_as_txt) report_as_txt)
......
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