Charles-Henri Decultot | b07f482 | 2018-09-05 07:30:14 +0200 | [diff] [blame] | 1 | from __future__ import unicode_literals |
| 2 | import unittest |
| 3 | import frappe |
| 4 | from frappe.contacts.address_and_contact import filter_dynamic_link_doctypes |
| 5 | |
| 6 | class TestSearch(unittest.TestCase): |
Suraj Shetty | 8e08698 | 2020-05-05 12:06:58 +0530 | [diff] [blame] | 7 | # Search for the word "cond", part of the word "conduire" (Lead) in french. |
Charles-Henri Decultot | b07f482 | 2018-09-05 07:30:14 +0200 | [diff] [blame] | 8 | def test_contact_search_in_foreign_language(self): |
| 9 | frappe.local.lang = 'fr' |
Suraj Shetty | 8e08698 | 2020-05-05 12:06:58 +0530 | [diff] [blame] | 10 | output = filter_dynamic_link_doctypes("DocType", "cond", "name", 0, 20, { |
| 11 | 'fieldtype': 'HTML', |
| 12 | 'fieldname': 'contact_html' |
| 13 | }) |
deepeshgarg007 | 723e76f | 2019-07-02 21:01:57 +0530 | [diff] [blame] | 14 | result = [['found' for x in y if x=="Lead"] for y in output] |
Charles-Henri Decultot | b07f482 | 2018-09-05 07:30:14 +0200 | [diff] [blame] | 15 | self.assertTrue(['found'] in result) |
| 16 | |
| 17 | def tearDown(self): |
| 18 | frappe.local.lang = 'en' |