2018-12-27 21:26:36 +13:00
|
|
|
# Copyright 2017 Tecnativa - Pedro M. Baeza
|
|
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
|
|
|
|
|
|
from odoo.tests import common
|
|
|
|
|
|
|
|
|
|
|
|
class TestMailDebrand(common.TransactionCase):
|
|
|
|
def setUp(self):
|
|
|
|
super().setUp()
|
2020-03-20 16:15:04 +01:00
|
|
|
self.default_arch = self.env.ref("mail.message_notification_email").arch
|
|
|
|
self.paynow_arch = self.env.ref("mail.mail_notification_paynow").arch
|
2018-12-27 21:26:36 +13:00
|
|
|
|
|
|
|
def test_default_debrand(self):
|
2020-03-20 16:15:04 +01:00
|
|
|
self.assertIn("using", self.default_arch)
|
2018-12-27 21:26:36 +13:00
|
|
|
res = self.env["mail.template"]._debrand_body(self.default_arch)
|
2020-03-20 16:15:04 +01:00
|
|
|
self.assertNotIn("using", res)
|
2018-12-27 21:26:36 +13:00
|
|
|
|
|
|
|
def test_paynow_debrand(self):
|
2020-03-20 16:15:04 +01:00
|
|
|
self.assertIn("Powered by", self.paynow_arch)
|
2018-12-27 21:26:36 +13:00
|
|
|
res = self.env["mail.template"]._debrand_body(self.paynow_arch)
|
2020-03-20 16:15:04 +01:00
|
|
|
self.assertNotIn("Powered by", res)
|