mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-16 11:39:18 +00:00
Test case for contact references (#15077)
* test case for contact references * Add teardown
This commit is contained in:
committed by
Nabin Hait
parent
f9c5da5df0
commit
b07f482c0c
16
erpnext/tests/test_search.py
Normal file
16
erpnext/tests/test_search.py
Normal file
@@ -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'
|
||||||
Reference in New Issue
Block a user