diff options
| author | Thibault Delavallée <tde@odoo.com> | 2019-10-24 11:09:01 +0000 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2019-12-02 15:18:44 +0000 |
| commit | e2b33f460d0f2359e65107f8615c7e827350b4e7 (patch) | |
| tree | aacc4e64a6253dc57f3369ba5e2cc67312dfe2ea /addons/test_mail/tests/test_mail_message.py | |
| parent | 06f169a0ee0f7508f861c47ee2f39467df7b6dc1 (diff) | |
[REF] mail, various: rename subtype parameter of message_post to subtype_xmlid
PURPOSE
Clean posting process and improve mail.message definition and comprehension.
SPECIFICATIONS
In order to be more explicit subtype parameter is renamed to subtype_xmlid.
It therefore clearly indicates it should be a valid subtype Xml ID. Support
of ill formatted Xml IDs is removed because there is no reason to try to
add some random prefix. Give something that exists or go to hell, punk !
LINKS
Task ID 2071556
PR #38692
Diffstat (limited to 'addons/test_mail/tests/test_mail_message.py')
| -rw-r--r-- | addons/test_mail/tests/test_mail_message.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/addons/test_mail/tests/test_mail_message.py b/addons/test_mail/tests/test_mail_message.py index 3f433496f4e..4f08f0abc18 100644 --- a/addons/test_mail/tests/test_mail_message.py +++ b/addons/test_mail/tests/test_mail_message.py @@ -360,13 +360,13 @@ class TestMessageAccess(TestMailCommon): ).with_context({'mail_create_nosubscribe': False}) # mark all as read clear needactions - group_private.message_post(body='Test', message_type='comment', subtype='mail.mt_comment', partner_ids=[emp_partner.id]) + group_private.message_post(body='Test', message_type='comment', subtype_xmlid='mail.mt_comment', partner_ids=[emp_partner.id]) emp_partner.env['mail.message'].mark_all_as_read(domain=[]) na_count = emp_partner.get_needaction_count() self.assertEqual(na_count, 0, "mark all as read should conclude all needactions") # mark all as read also clear inaccessible needactions - new_msg = group_private.message_post(body='Zest', message_type='comment', subtype='mail.mt_comment', partner_ids=[emp_partner.id]) + new_msg = group_private.message_post(body='Zest', message_type='comment', subtype_xmlid='mail.mt_comment', partner_ids=[emp_partner.id]) needaction_accessible = len(emp_partner.env['mail.message'].search([['needaction', '=', True]])) self.assertEqual(needaction_accessible, 1, "a new message to a partner is readable to that partner") @@ -388,13 +388,13 @@ class TestMessageAccess(TestMailCommon): portal_partner = self.user_portal.partner_id.with_user(self.user_portal) # mark all as read clear needactions - self.group_pigs.message_post(body='Test', message_type='comment', subtype='mail.mt_comment', partner_ids=[portal_partner.id]) + self.group_pigs.message_post(body='Test', message_type='comment', subtype_xmlid='mail.mt_comment', partner_ids=[portal_partner.id]) portal_partner.env['mail.message'].mark_all_as_read(domain=[]) na_count = portal_partner.get_needaction_count() self.assertEqual(na_count, 0, "mark all as read should conclude all needactions") # mark all as read also clear inaccessible needactions - new_msg = self.group_pigs.message_post(body='Zest', message_type='comment', subtype='mail.mt_comment', partner_ids=[portal_partner.id]) + new_msg = self.group_pigs.message_post(body='Zest', message_type='comment', subtype_xmlid='mail.mt_comment', partner_ids=[portal_partner.id]) needaction_accessible = len(portal_partner.env['mail.message'].search([['needaction', '=', True]])) self.assertEqual(needaction_accessible, 1, "a new message to a partner is readable to that partner") |
