Mathias 6 years ago
parent
commit
fb832769ea
  1. 4
      muk_web_preview_attachment/tests/test_attachment_extension.py
  2. 2
      muk_web_preview_mail/tests/test_mail_parse.py

4
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",

2
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",

Loading…
Cancel
Save