Commit afd7b80b authored by Yusei Tahara's avatar Yusei Tahara

Add a real test for scriptable key.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25763 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9e07d9c1
...@@ -731,6 +731,20 @@ class TestDocument(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -731,6 +731,20 @@ class TestDocument(ERP5TypeTestCase, ZopeTestCase.Functional):
self.portal.portal_catalog(portal_search_text='') self.portal.portal_catalog(portal_search_text='')
self.portal.portal_catalog(portal_search_text='a search text') self.portal.portal_catalog(portal_search_text='a search text')
# Create a document.
document_1 = self.portal.document_module.newContent(portal_type='File')
document_1.setDescription('Hello. ScriptableKey is very useful if you want to make your own search syntax.')
document_2 = self.portal.document_module.newContent(portal_type='File')
document_2.setDescription('This test make sure that scriptable key feature on ZSQLCatalog works.')
get_transaction().commit()
self.tic()
# Use scriptable key to search above documents.
self.assertEqual(len(self.portal.portal_catalog(advanced_search_text='ScriptableKey')), 1)
self.assertEqual(len(self.portal.portal_catalog(advanced_search_text='RelatedKey')), 0)
self.assertEqual(len(self.portal.portal_catalog(advanced_search_text='make')), 2)
def test_PDFTextContent(self): def test_PDFTextContent(self):
upload_file = makeFileUpload('REF-en-001.pdf') upload_file = makeFileUpload('REF-en-001.pdf')
document = self.portal.portal_contributions.newContent(file=upload_file) document = self.portal.portal_contributions.newContent(file=upload_file)
......
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