From b07f482c0cdc827b0b8d73bd920d9d302d006a91 Mon Sep 17 00:00:00 2001 From: Charles-Henri Decultot Date: Wed, 5 Sep 2018 07:30:14 +0200 Subject: [PATCH] Test case for contact references (#15077) * test case for contact references * Add teardown --- erpnext/tests/test_search.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 erpnext/tests/test_search.py diff --git a/erpnext/tests/test_search.py b/erpnext/tests/test_search.py new file mode 100644 index 00000000000..ab8eca3a3b0 --- /dev/null +++ b/erpnext/tests/test_search.py @@ -0,0 +1,16 @@ +from __future__ import unicode_literals +import unittest +import frappe +from frappe.contacts.address_and_contact import filter_dynamic_link_doctypes + +class TestSearch(unittest.TestCase): + #Search for the word "clie", part of the word "client" (customer) in french. + def test_contact_search_in_foreign_language(self): + frappe.local.lang = 'fr' + output = filter_dynamic_link_doctypes("DocType", "clie", "name", 0, 20, {'fieldtype': 'HTML', 'fieldname': 'contact_html'}) + + result = [['found' for x in y if x=="Customer"] for y in output] + self.assertTrue(['found'] in result) + + def tearDown(self): + frappe.local.lang = 'en' \ No newline at end of file