brotherton-erpnext/erpnext/tests/test_search.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
594 B
Python
Raw Normal View History

import unittest
import frappe
from frappe.contacts.address_and_contact import filter_dynamic_link_doctypes
class TestSearch(unittest.TestCase):
# Search for the word "cond", part of the word "conduire" (Lead) in french.
def test_contact_search_in_foreign_language(self):
2021-01-08 09:07:38 +00:00
try:
frappe.local.lang = 'fr'
output = filter_dynamic_link_doctypes("DocType", "cond", "name", 0, 20, {
'fieldtype': 'HTML',
'fieldname': 'contact_html'
})
result = [['found' for x in y if x=="Lead"] for y in output]
self.assertTrue(['found'] in result)
finally:
frappe.local.lang = 'en'