2018-09-05 05:30:14 +00:00
|
|
|
from __future__ import unicode_literals
|
|
|
|
import unittest
|
|
|
|
import frappe
|
|
|
|
from frappe.contacts.address_and_contact import filter_dynamic_link_doctypes
|
|
|
|
|
|
|
|
class TestSearch(unittest.TestCase):
|
2019-07-02 15:31:57 +00:00
|
|
|
#Search for the word "cond", part of the word "conduire" (Lead) in french.
|
2018-09-05 05:30:14 +00:00
|
|
|
def test_contact_search_in_foreign_language(self):
|
|
|
|
frappe.local.lang = 'fr'
|
2019-08-09 09:18:26 +00:00
|
|
|
output = filter_dynamic_link_doctypes("DocType", "prospect", "name", 0, 20, {'fieldtype': 'HTML', 'fieldname': 'contact_html'})
|
2018-09-05 05:30:14 +00:00
|
|
|
|
2019-07-02 15:31:57 +00:00
|
|
|
result = [['found' for x in y if x=="Lead"] for y in output]
|
2018-09-05 05:30:14 +00:00
|
|
|
self.assertTrue(['found'] in result)
|
|
|
|
|
|
|
|
def tearDown(self):
|
|
|
|
frappe.local.lang = 'en'
|