blob: 3594cfee335c9a86c6e9867effa6a912cb07d8bb [file] [log] [blame]
Chillar Anand915b3432021-09-02 16:44:59 +05301
Charles-Henri Decultotb07f4822018-09-05 07:30:14 +02002import unittest
Chillar Anand915b3432021-09-02 16:44:59 +05303
Charles-Henri Decultotb07f4822018-09-05 07:30:14 +02004import frappe
5from frappe.contacts.address_and_contact import filter_dynamic_link_doctypes
6
Chillar Anand915b3432021-09-02 16:44:59 +05307
Charles-Henri Decultotb07f4822018-09-05 07:30:14 +02008class TestSearch(unittest.TestCase):
Suraj Shetty8e086982020-05-05 12:06:58 +05309 # Search for the word "cond", part of the word "conduire" (Lead) in french.
Charles-Henri Decultotb07f4822018-09-05 07:30:14 +020010 def test_contact_search_in_foreign_language(self):
Rushabh Mehtaf8a6dde2021-01-08 14:37:38 +053011 try:
12 frappe.local.lang = 'fr'
13 output = filter_dynamic_link_doctypes("DocType", "cond", "name", 0, 20, {
14 'fieldtype': 'HTML',
15 'fieldname': 'contact_html'
16 })
17 result = [['found' for x in y if x=="Lead"] for y in output]
18 self.assertTrue(['found'] in result)
19 finally:
20 frappe.local.lang = 'en'