blob: 566495f1eccd8bfe2949f274304bcbc3533bfcf5 [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):
Suraj Shetty8e086982020-05-05 12:06:58 +05307 # Search for the word "cond", part of the word "conduire" (Lead) in french.
Charles-Henri Decultotb07f4822018-09-05 07:30:14 +02008 def test_contact_search_in_foreign_language(self):
9 frappe.local.lang = 'fr'
Suraj Shetty8e086982020-05-05 12:06:58 +053010 output = filter_dynamic_link_doctypes("DocType", "cond", "name", 0, 20, {
11 'fieldtype': 'HTML',
12 'fieldname': 'contact_html'
13 })
deepeshgarg007723e76f2019-07-02 21:01:57 +053014 result = [['found' for x in y if x=="Lead"] for y in output]
Charles-Henri Decultotb07f4822018-09-05 07:30:14 +020015 self.assertTrue(['found'] in result)
16
17 def tearDown(self):
18 frappe.local.lang = 'en'