You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
1.0 KiB

  1. # -*- coding: utf-8 -*-
  2. # Copyright 2017 Eficent Business and IT Consulting Services S.L.
  3. # (http://www.eficent.com)
  4. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  5. from odoo.tests.common import TransactionCase
  6. class TestBaseSearchMailContent(TransactionCase):
  7. def setUp(self):
  8. super(TestBaseSearchMailContent, self).setUp()
  9. self.channel_obj = self.env["mail.channel"]
  10. def test_base_search_mail_content_1(self):
  11. res = self.channel_obj.search(
  12. [('message_content', 'ilike', 'xxxyyyzzz')])
  13. self.assertFalse(res, "You have a channel with xxxyyyzzz :O")
  14. def test_base_search_mail_content_2(self):
  15. res = self.channel_obj.load_views(
  16. [[False, 'search']], {'load_fields': False,
  17. 'load_filters': True,
  18. 'toolbar': True})
  19. self.assertIn(
  20. 'message_content', res['fields_views']['search']['fields'],
  21. "message_content field was not detected")