blob: ab8eca3a3b0c9bf5df7a04db8da1bf4b02e30865 [file] [log] [blame]
Charles-Henri Decultotb07f4822018-09-05 07:30:14 +02001from __future__ import unicode_literals
2import unittest
3import frappe
4from frappe.contacts.address_and_contact import filter_dynamic_link_doctypes
5
6class 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'