Files
odoo_source/addons/mass_mailing/tests/test_mailing_ui.py
T
Antoine GuenetandNicolas Bayet c40d9357fd [IMP] web_editor: apply rules only where needed
This improves performance of `classToStyle` by first selecting which
nodes and which rules will be concerned.
When parsing the css rules, we computed their specificity and normalized
their styles one by one. This applies these processes only on the
concerned rules, all at once.

X-original-commit: bb28624dcd69efe1aff546b37e66c05c001a5927
Part-of: odoo/odoo#84513
Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
2022-02-14 14:51:25 +00:00

24 lines
1.1 KiB
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import odoo.tests
from odoo.addons.base.tests.common import HttpCaseWithUserDemo
@odoo.tests.tagged('-at_install', 'post_install')
class TestUi(HttpCaseWithUserDemo):
def setUp(self):
super().setUp()
self.user_demo.groups_id |= self.env.ref('mass_mailing.group_mass_mailing_user')
self.user_demo.groups_id |= self.env.ref('mail.group_mail_template_editor')
def test_01_mass_mailing_editor_tour(self):
self.start_tour("/web", 'mass_mailing_editor_tour', login="demo")
mail = self.env['mailing.mailing'].search([('subject', '=', 'Test')])[0]
# The tour created and saved an email. The edited version should be
# saved in body_arch, and its transpiled version (see convert_inline)
# for email client compatibility should be saved in body_html. This
# ensures both fields have different values.
self.assertEqual(mail.body_arch, '<p><br></p>')
self.assertEqual(mail.body_html, '<p style="margin:0px 0 14px 0;box-sizing:border-box;"><br></p>')