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 ...@@ -65,6 +65,7 @@ from zLOG import LOG
from Products.ERP5.Document.Document import NotConvertedError from Products.ERP5.Document.Document import NotConvertedError
from Products.ERP5Form.PreferenceTool import Priority from Products.ERP5Form.PreferenceTool import Priority
from Products.ERP5Type.tests.utils import createZODBPythonScript from Products.ERP5Type.tests.utils import createZODBPythonScript
from Products.ERP5Type.Globals import get_request
import os import os
from threading import Thread from threading import Thread
import httplib import httplib
...@@ -2000,6 +2001,30 @@ return 1 ...@@ -2000,6 +2001,30 @@ return 1
# if PDF size is larger than A4 format system should deny conversion # if PDF size is larger than A4 format system should deny conversion
self.assertRaises(Unauthorized, pdf.convert, format='jpeg') 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): class TestDocumentWithSecurity(TestDocumentMixin):
username = 'yusei' 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