diff --git a/muk_web_preview_attachment/tests/test_attachment_extension.py b/muk_web_preview_attachment/tests/test_attachment_extension.py index bb98835..45726ec 100644 --- a/muk_web_preview_attachment/tests/test_attachment_extension.py +++ b/muk_web_preview_attachment/tests/test_attachment_extension.py @@ -43,7 +43,7 @@ class AttachmentExtensionTestCase(common.TransactionCase): super(AttachmentExtensionTestCase, self).tearDown() def test_attachment_extension_filename(self): - with closing(open(os.path.join(_path, 'tests/data/sample.png'), 'r')) as file: + with closing(open(os.path.join(_path, 'tests/data/sample.png'), 'rb')) as file: self.sample = self.attachment_model.create({ 'name': "test", 'datas_fname': "sample.png", @@ -52,7 +52,7 @@ class AttachmentExtensionTestCase(common.TransactionCase): self.assertEqual(self.sample.extension, ".png") def test_attachment_extension_mimetype(self): - with closing(open(os.path.join(_path, 'tests/data/sample.png'), 'r')) as file: + with closing(open(os.path.join(_path, 'tests/data/sample.png'), 'rb')) as file: self.sample = self.attachment_model.create({ 'name': "test", 'mimetype': "image/png", diff --git a/muk_web_preview_mail/tests/test_mail_parse.py b/muk_web_preview_mail/tests/test_mail_parse.py index 64283ed..0e7f5e6 100644 --- a/muk_web_preview_mail/tests/test_mail_parse.py +++ b/muk_web_preview_mail/tests/test_mail_parse.py @@ -40,7 +40,7 @@ class MailParseTestCase(common.TransactionCase): def setUp(self): super(MailParseTestCase, self).setUp() self.attachment_model = self.env['ir.attachment'].sudo() - with closing(open(os.path.join(_path, 'tests/data/sample.eml'), 'r')) as file: + with closing(open(os.path.join(_path, 'tests/data/sample.eml'), 'rb')) as file: self.sample_mail_attachment = self.attachment_model.create({ 'name': 'SampleMail', 'datas_fname': "sample.eml",