Commit 3d653ffe authored by Sven Franck's avatar Sven Franck

erp5_corporate_identity: add test to dump mhtml

parent e59623bf
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Page" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>Template.Test.Slideshow.Expected.Output.Sample</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>slideshow mhtml output</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>template_test_slideshow_output_expected_004_en_html</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Page</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Template Test Slideshow Expected Output Sample</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>004</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -105,6 +105,10 @@
<string>pdf</string>
<string>pdf</string>
</tuple>
<tuple>
<string>mhtml</string>
<string>mhtml</string>
</tuple>
</list>
</value>
</item>
......
......@@ -326,10 +326,10 @@ if getDetails(doc_content) > -1:
# XXX split content above 1600 chars into multiple details tags?
doc_content = doc_content.replace(slide, details)
# ============================= Format: html ===================================
if doc_format == "html":
# ======================== Format: html/mhtml ==================================
if doc_format == "html" or doc_format == "mhtml":
doc.REQUEST.RESPONSE.setHeader("Content-Type", "text/html;")
return context.WebPage_createSlideshow(
doc_output = context.WebPage_createSlideshow(
doc_format=doc_format,
doc_theme=doc_theme.get("theme"),
doc_title=doc_title,
......@@ -345,6 +345,10 @@ if doc_format == "html":
doc_css=doc_css,
doc_content=doc_content
)
if doc_format == "html":
return doc_output
if doc_format == "mhtml":
return doc.Base_convertHtmlToSingleFile(doc_output, allow_script=True)
# ============================= Format: pdf ====================================
if doc_format == "pdf":
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testCorporateIdentityTemplatesDump</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Test to dump mhtml passed into cloudooo</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testCorporateIdentityTemplatesDump</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple>
<string>W: 30, 0: Unused createZODBPythonScript imported from Products.ERP5Type.tests.utils (unused-import)</string>
<string>W: 32, 0: Unused import transaction (unused-import)</string>
<string>W: 33, 0: Unused import functools (unused-import)</string>
</tuple>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>draft</string> </value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
test.erp5.testCorporateIdentityTemplates
\ No newline at end of file
test.erp5.testCorporateIdentityTemplates
test.erp5.testCorporateIdentityTemplatesDump
\ No newline at end of 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