Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f7eeb11
commit 110b28d
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2017 Eficent Business and IT Consulting Services S.L. | ||
# (http://www.eficent.com) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
from . import test_base_search_mail_content |
25 changes: 25 additions & 0 deletions
25
base_search_mail_content/tests/test_base_search_mail_content.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2017 Eficent Business and IT Consulting Services S.L. | ||
# (http://www.eficent.com) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
from odoo.tests.common import TransactionCase | ||
|
||
|
||
class TestBaseSearchMailContent(TransactionCase): | ||
def setUp(self): | ||
super(TestBaseSearchMailContent, self).setUp() | ||
self.channel_obj = self.env["mail.channel"] | ||
|
||
def test_base_search_mail_content_1(self): | ||
res = self.channel_obj.search( | ||
[('message_content', 'ilike', 'xxxyyyzzz')]) | ||
self.assertFalse(res, "You have a channel with xxxyyyzzz :O") | ||
|
||
def test_base_search_mail_content_2(self): | ||
res = self.channel_obj.load_views( | ||
[[False, 'search']], {'load_fields': False, | ||
'load_filters': True, | ||
'toolbar': True}) | ||
self.assertIn( | ||
'message_content', res['fields_views']['search']['fields'], | ||
"message_content field was not detected") |