blob: a6619b278e1e96593a27d62bccf3b45a2b7bdb33 [file] [log] [blame]
Charles-Henri Decultotb07f4822018-09-05 07:30:14 +02001from __future__ import unicode_literals
Chillar Anand915b3432021-09-02 16:44:59 +05302
Charles-Henri Decultotb07f4822018-09-05 07:30:14 +02003import unittest
Chillar Anand915b3432021-09-02 16:44:59 +05304
Charles-Henri Decultotb07f4822018-09-05 07:30:14 +02005import frappe
6from frappe.contacts.address_and_contact import filter_dynamic_link_doctypes
7
Chillar Anand915b3432021-09-02 16:44:59 +05308
Charles-Henri Decultotb07f4822018-09-05 07:30:14 +02009class TestSearch(unittest.TestCase):
Suraj Shetty8e086982020-05-05 12:06:58 +053010 # Search for the word "cond", part of the word "conduire" (Lead) in french.
Charles-Henri Decultotb07f4822018-09-05 07:30:14 +020011 def test_contact_search_in_foreign_language(self):
Rushabh Mehtaf8a6dde2021-01-08 14:37:38 +053012 try:
13 frappe.local.lang = 'fr'
14 output = filter_dynamic_link_doctypes("DocType", "cond", "name", 0, 20, {
15 'fieldtype': 'HTML',
16 'fieldname': 'contact_html'
17 })
18 result = [['found' for x in y if x=="Lead"] for y in output]
19 self.assertTrue(['found'] in result)
20 finally:
21 frappe.local.lang = 'en'