blob: b9665dbd765ea695ce7e6237d84cb9fcdd83206a [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'
Mangesh-Khairnar7c7e9ec2019-08-09 14:48:26 +053010 output = filter_dynamic_link_doctypes("DocType", "prospect", "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'