blob: 8a93b6a5a80b6d4d832d3bca024d3da1a398f2e9 [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):
deepeshgarg007723e76f2019-07-02 21:01:57 +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'
deepeshgarg007723e76f2019-07-02 21:01:57 +053010 output = filter_dynamic_link_doctypes("DocType", "cond", "name", 0, 20, {'fieldtype': 'HTML', 'fieldname': 'contact_html'})
Charles-Henri Decultotb07f4822018-09-05 07:30:14 +020011
deepeshgarg007723e76f2019-07-02 21:01:57 +053012 result = [['found' for x in y if x=="Lead"] for y in output]
Charles-Henri Decultotb07f4822018-09-05 07:30:14 +020013 self.assertTrue(['found'] in result)
14
15 def tearDown(self):
16 frappe.local.lang = 'en'