Skip to content

Commit 4a40213

Browse files
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM+MPHfW8vX4CgPA9taZb1mBMAs/IJYfo41AHEi6N46i m.francke@secure42.de
[IMP] increase test coverage [IMP] increase test coverage [IMP] increase test coverage fghf fgghf dfdfg
1 parent f952b15 commit 4a40213

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

mail_quoted_reply/tests/test_reply.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ def test_unquoted_reply(self):
7171
wizard = (
7272
self.env[action["res_model"]].with_context(**action["context"]).create({})
7373
)
74+
wizard = wizard.with_context(
75+
default_subject="Some subject for testing purposes"
76+
)
7477
self.assertTrue(wizard.partner_ids)
7578
self.assertEqual(message.email_from, wizard.partner_ids.email_formatted)
7679
# the onchange in the composer isn't triggered in tests, so we check for the

mail_quoted_reply/wizard/mail_compose_message.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from markupsafe import Markup
22

3-
from odoo import api, models, tools
3+
from odoo import api, models
44

55

66
class MailComposeMessage(models.TransientModel):
@@ -31,7 +31,8 @@ def _compute_body(self):
3131
def _compute_subject(self):
3232
res = super()._compute_subject()
3333
for composer in self:
34-
subj = composer.env.context.get("default_subject", False)
34+
context = composer.env.context
35+
subj = context.get("default_subject", False)
3536
if subj:
36-
composer.subject = tools.ustr(subj)
37+
composer.subject = str(subj)
3738
return res

0 commit comments

Comments
 (0)