def test_link_search_in_foreign_language(self): frappe.local.lang = 'fr' search_widget(doctype="DocType", txt="pay", page_length=20) output = frappe.response["values"] result = [['found' for x in y if x == "Country"] for y in output] self.assertTrue(['found'] in result)
def test_link_search_in_foreign_language(self): frappe.local.lang = 'fr' search_widget(doctype="DocType", txt="pay", page_length=20) output = frappe.response["values"] result = [['found' for x in y if x=="Country"] for y in output] self.assertTrue(['found'] in result)
def test_link_search_in_foreign_language(self): try: frappe.local.lang = "fr" frappe.local.lang_full_dict = None # discard translation cache search_widget(doctype="DocType", txt="pay", page_length=20) output = frappe.response["values"] result = [["found" for x in y if x == "Country"] for y in output] self.assertTrue(["found"] in result) finally: frappe.local.lang = "en"
def search_link(doctype, txt, query=None, filters=None, page_length=20, searchfield=None, reference_doctype=None, ignore_user_permissions=False): if doctype == "Item": query = "peark.controllers.queries.item_query" search_widget(doctype, txt, query, searchfield=searchfield, page_length=page_length, filters=filters, reference_doctype=reference_doctype, ignore_user_permissions=ignore_user_permissions) frappe.response['results'] = \ build_for_autosuggest(frappe.response["values"]) del frappe.response["values"]
def search_link(doctype, txt, query=None, filters=None, page_length=20, searchfield=None, reference_doctype=None, ignore_user_permissions=False): search_widget(doctype, txt, query, searchfield=searchfield, page_length=page_length, filters=filters, reference_doctype=reference_doctype, ignore_user_permissions=ignore_user_permissions) if frappe.response["values"]: frappe.response['results'] = build_for_autosuggest(frappe.response["values"]) del frappe.response["values"]