Commit 11ec803f authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

check if ingested File document works fine with SearchableText() method, that...

check if ingested File document works fine with SearchableText() method, that currently fails for XML ingestion.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38720 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6d21f5b6
......@@ -290,6 +290,9 @@ class TestIngestion(ERP5TypeTestCase):
self.assertEquals(document.getExternalProcessingState(), 'converted')
self.assert_('magic' in document.SearchableText())
self.assert_('magic' in str(document.asText()))
else:
# check if SearchableText() does not raise any exception
document.SearchableText()
def checkDocumentExportList(self, document_id, format, asserted_target_list):
"""
......@@ -470,6 +473,13 @@ class TestIngestion(ERP5TypeTestCase):
"""
self.newEmptyCataloggedDocument('Image', 'six')
def stepCreateFileDocument(self, sequence=None, sequence_list=None, **kw):
"""
Create an empty File document with ID 'file'
This document will be used in most tests.
"""
self.newEmptyCataloggedDocument('File', 'file')
def stepCheckEmptyState(self, sequence=None, sequence_list=None, **kw):
"""
Check if the document is in "empty" processing state
......@@ -731,6 +741,13 @@ class TestIngestion(ERP5TypeTestCase):
format_list = ['jpg', 'gif', 'bmp', 'png']
self.ingestFormatList('six', format_list, 'Image')
def stepIngestFileFormats(self, sequence=None, sequence_list=None, **kw):
"""
ingest all supported file formats
"""
format_list = ['txt', 'rss', 'xml',]
self.ingestFormatList('file', format_list)
def stepCheckTextDocumentExportList(self, sequence=None, sequence_list=None, **kw):
self.checkDocumentExportList('one', 'doc', ['pdf', 'doc', 'rtf', 'writer.html', 'txt'])
......@@ -1135,6 +1152,14 @@ class TestIngestion(ERP5TypeTestCase):
]
self.playSequence(step_list, quiet)
def test_05_FormatIngestionFile(self, quiet=QUIET, run=RUN_ALL_TEST):
if not run: return
if not quiet: printAndLog('test_05_FormatIngestion')
step_list = ['stepCleanUp'
,'stepCreateFileDocument'
,'stepIngestFileFormats'
]
self.playSequence(step_list, quiet)
# Test generation of files in all possible formats
# which means check if they have correct lists of available formats for export
......
<?xml version="1.0"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" version="2.0">
<channel>
<atom:link rel="self" type="application/rss+xml" href="http://example.com/WebSection_viewContentListAsRSS"/>
<title>example.com</title>
<link>http://example.com</link>
<description/>
<item>
<guid>http://example.com/document_module/2</guid>
<link>http://example.com/document_module/2</link>
<description/>
<pubDate>Mon, 27 Sep 2010 01:00:00 +0200</pubDate>
<title>title of document 2</title>
</item>
<item>
<guid>http://example.com/document_module/1</guid>
<link>http://example.com/document_module/1</link>
<description/>
<pubDate>Mon, 27 Sep 2010 00:00:00 +0200</pubDate>
<title>title of document 1</title>
</item>
</channel>
</rss>
<?xml version="1.0"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" version="2.0">
<channel>
<atom:link rel="self" type="application/rss+xml" href="http://example.com/WebSection_viewContentListAsRSS"/>
<title>example.com</title>
<link>http://example.com</link>
<description/>
<item>
<guid>http://example.com/document_module/2</guid>
<link>http://example.com/document_module/2</link>
<description/>
<pubDate>Mon, 27 Sep 2010 01:00:00 +0200</pubDate>
<title>title of document 2</title>
</item>
<item>
<guid>http://example.com/document_module/1</guid>
<link>http://example.com/document_module/1</link>
<description/>
<pubDate>Mon, 27 Sep 2010 00:00:00 +0200</pubDate>
<title>title of document 1</title>
</item>
</channel>
</rss>
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