Commit 39719b16 authored by Ivan Tyagov's avatar Ivan Tyagov

Add test for getTargetFormatItemList API.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36816 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 083df40c
...@@ -1868,7 +1868,33 @@ return 1 ...@@ -1868,7 +1868,33 @@ return 1
self.stepTic() self.stepTic()
self.assertTrue(web_page_5==web_page_6) self.assertTrue(web_page_5==web_page_6)
self.assertTrue(web_page_6.getRevision()=='7') self.assertTrue(web_page_6.getRevision()=='7')
def test_getTargetFormatItemList(self):
"""
Test getting target conversion format item list.
Note: this tests assumes the default formats do exists for some content types.
as this is a matter of respective oinfiguration of mimetypes_registry & portal_transforms
only the basic minium of transorm to formats is tested.
"""
portal_type = 'PDF'
module = self.portal.getDefaultModule(portal_type)
upload_file = makeFileUpload('TEST.Large.Document.pdf')
pdf = module.newContent(portal_type=portal_type, file=upload_file)
self.assertTrue('html' in pdf.getTargetFormatList())
self.assertTrue('png' in pdf.getTargetFormatList())
self.assertTrue('txt' in pdf.getTargetFormatList())
web_page=self.portal.web_page_module.newContent(portal_type='Web Page',
content_type='text/html')
self.assertTrue('odt' in web_page.getTargetFormatList())
self.assertTrue('txt' in web_page.getTargetFormatList())
image=self.portal.image_module.newContent(portal_type='Image',
content_type='image/png')
self.assertTrue('txt' in image.getTargetFormatList())
class TestDocumentWithSecurity(TestDocumentMixin): class TestDocumentWithSecurity(TestDocumentMixin):
......
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