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): |
| 7 | #Search for the word "clie", part of the word "client" (customer) in french. |
| 8 | def test_contact_search_in_foreign_language(self): |
| 9 | frappe.local.lang = 'fr' |
| 10 | output = filter_dynamic_link_doctypes("DocType", "clie", "name", 0, 20, {'fieldtype': 'HTML', 'fieldname': 'contact_html'}) |
| 11 | |
| 12 | result = [['found' for x in y if x=="Customer"] for y in output] |
| 13 | self.assertTrue(['found'] in result) |
| 14 | |
| 15 | def tearDown(self): |
| 16 | frappe.local.lang = 'en' |