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.

24 lines
1008 B

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