"tests/mysql_client_test.c" did not exist on "3256fd704ed7a8a2ee0af8933ba27222eded4c0b"
Commit 657ab951 authored by Ivan Tyagov's avatar Ivan Tyagov

Create test for getting searchable text.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38400 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 92f1a040
......@@ -65,6 +65,7 @@ from zLOG import LOG
from Products.ERP5.Document.Document import NotConvertedError
from Products.ERP5Form.PreferenceTool import Priority
from Products.ERP5Type.tests.utils import createZODBPythonScript
from Products.ERP5Type.Globals import get_request
import os
from threading import Thread
import httplib
......@@ -2000,6 +2001,30 @@ return 1
# if PDF size is larger than A4 format system should deny conversion
self.assertRaises(Unauthorized, pdf.convert, format='jpeg')
def test_getSearchText(self):
"""
Test extracting search text script.
"""
request = get_request()
portal = self.portal
# test direct passing argument_name_list
request.set('MySearchableText', 'MySearchableText_value')
self.assertEqual(request.get('MySearchableText'),
portal.Base_getSearchText(argument_name_list=['MySearchableText']))
# simulate script being called in a listbox
# to simulate this we set 'global_search_column' a listbox
form = portal.DocumentModule_viewDocumentList
listbox = form.listbox
listbox.manage_edit_surcharged_xmlrpc(dict(
global_search_column='advanced_search_text'))
# render listbox
listbox.render()
request.set('advanced_search_text', 'advanced_search_text_value')
self.assertEqual(request.get('advanced_search_text'),
portal.Base_getSearchText())
class TestDocumentWithSecurity(TestDocumentMixin):
username = 'yusei'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment