blob: f60e5e4d983507f8a1b4a5c7a1fdcf51daa0a805 [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):
Rushabh Mehtaf8a6dde2021-01-08 14:37:38 +05309 try:
10 frappe.local.lang = 'fr'
11 output = filter_dynamic_link_doctypes("DocType", "cond", "name", 0, 20, {
12 'fieldtype': 'HTML',
13 'fieldname': 'contact_html'
14 })
15 result = [['found' for x in y if x=="Lead"] for y in output]
16 self.assertTrue(['found'] in result)
17 finally:
18 frappe.local.lang = 'en'