Mathias Markl 7 years ago
parent
commit
e6870c63ff
  1. 1
      muk_web_preview_mail/__manifest__.py
  2. 0
      muk_web_preview_mail/demo/data/sample.eml
  3. 13
      muk_web_preview_mail/demo/preview_mail_demo.xml
  4. 8
      muk_web_preview_mail/tests/test_mail_parse.py

1
muk_web_preview_mail/__manifest__.py

@ -43,6 +43,7 @@
"template/assets.xml",
],
"demo": [
"demo/preview_mail_demo.xml",
],
"qweb": [
"static/src/xml/*.xml",

0
muk_web_preview_mail/tests/data/sample.eml → muk_web_preview_mail/demo/data/sample.eml

13
muk_web_preview_mail/demo/preview_mail_demo.xml

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record id="mail_attachment_demo" model="ir.attachment">
<field name="name">sample.eml</field>
<field name="datas_fname">sample.eml</field>
<field name="datas" type="base64" file="muk_web_preview_mail/demo/data/sample.eml"/>
</record>
</data>
</odoo>

8
muk_web_preview_mail/tests/test_mail_parse.py

@ -45,13 +45,7 @@ class MailParseTestCase(common.HttpCase):
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'), 'rb')) as file:
self.sample_mail_attachment = self.attachment_model.create({
'name': 'SampleMail',
'datas_fname': "sample.eml",
'datas': base64.b64encode(file.read()),
})
self.attachment_model = self.browse_ref('muk_web_preview_mail.mail_attachment_demo')
def tearDown(self):
super(MailParseTestCase, self).tearDown()

Loading…
Cancel
Save