Skip to content

Commit

Permalink
[ADD] Simple test 馃槑
Browse files Browse the repository at this point in the history
  • Loading branch information
MiquelRForgeFlow committed Sep 19, 2017
1 parent f7eeb11 commit 110b28d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
5 changes: 5 additions & 0 deletions base_search_mail_content/tests/__init__.py
@@ -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 base_search_mail_content/tests/test_base_search_mail_content.py
@@ -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")

0 comments on commit 110b28d

Please sign in to comment.