Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] mail_composer_cc_bcc: fix test scripts #1523

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions mail_composer_cc_bcc/tests/test_mail_cc_bcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,35 +96,35 @@ def test_template_cc_bcc(self):
# Company default values
env.company.default_partner_cc_ids = self.partner_cc3
env.company.default_partner_bcc_ids = self.partner_cc2
# Product template values
tmpl_model = env["ir.model"].search([("model", "=", "product.template")])
# Res Partner values
res_partner_model = env["ir.model"].search([("model", "=", "res.partner")])
partner_cc = self.partner_cc
partner_bcc = self.partner_bcc
vals = {
"name": "Product Template: Re: [E-COM11] Cabinet with Doors",
"model_id": tmpl_model.id,
"subject": "Re: [E-COM11] Cabinet with Doors",
"name": "Contact: New Contact",
"model_id": res_partner_model.id,
"subject": "Re: New Contact",
"body_html": """<p style="margin:0px 0 12px 0;box-sizing:border-box;">
Test Template<br></p>""",
New Contact<br></p>""",
"email_cc": tools.formataddr(
(partner_cc.name or "False", partner_cc.email or "False")
),
"email_bcc": tools.formataddr(
(partner_bcc.name or "False", partner_bcc.email or "False")
),
}
prod_tmpl = env["mail.template"].create(vals)
mail_tmpl = env["mail.template"].create(vals)
# Open mail composer form and check for default values from company
form = self.open_mail_composer_form()
composer = form.save()
self.assertEqual(composer.partner_cc_ids, self.partner_cc3)
self.assertEqual(composer.partner_bcc_ids, self.partner_cc2)
# Change email template and check for values from it
form.template_id = prod_tmpl
form.template_id = mail_tmpl
composer = form.save()
# Beside existing Cc and Bcc, add template's ones
form = Form(composer)
form.template_id = prod_tmpl
form.template_id = mail_tmpl
composer = form.save()
expecting = self.partner_cc3 + self.partner_cc
self.assertEqual(composer.partner_cc_ids, expecting)
Expand All @@ -139,7 +139,7 @@ def test_template_cc_bcc(self):
form.template_id = env["mail.template"]
form.save()
self.assertFalse(form.template_id)
form.template_id = prod_tmpl
form.template_id = mail_tmpl
composer = form.save()
expecting = self.partner_cc3 + self.partner_cc
self.assertEqual(composer.partner_cc_ids, expecting)
Expand Down
Loading