Commit 6b343fc6 authored by Sven Franck's avatar Sven Franck

erp5_corporate_identity: add back previously corrupt pdf, fixes for tests

parent e5e197df
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PDF" 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>_EtagSupport__etag</string> </key>
<value> <string>ts13099734.13</string> </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>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>8e05f3583b1404fc2b3c2c1abc3a9ce4</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/pdf</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>Template.Test.Leaflet</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>test leaflet without anything set.</string> </value>
</item>
<item>
<key> <string>filename</string> </key>
<value> <string>Template.Test.Leaflet-001-en.pdf</string> </value>
</item>
<item>
<key> <string>height</string> </key>
<value> <int>-1</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>template_test_leaflet_input_001_en_pdf</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>PDF</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>115071</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Template Test Leaflet</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <int>-1</int> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAY=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAc=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="6" aka="AAAAAAAAAAY=">
<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>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1513099714.29</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>draft</string> </value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record id="7" aka="AAAAAAAAAAc=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>964.5784.49253.4488</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1513099734.14</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
......@@ -2,7 +2,7 @@ if id is None:
return "Failed. Missing image id."
if context.getPortalType() != "PDF":
return "Failed. Not a pdf."
if context.getId().find("template_test") == -1:
if context.getId().find("template_") == -1:
return "Failed. Not a template test item."
pdf_page = context
......
......@@ -34,6 +34,11 @@ citation_ad_doubles = {}
citation_rd_doubles = {}
for citation in re.findall('\[(.*?)\]', document_content or ''):
# disregard empty brackets
if citation == blank:
continue
citation_href = (re.findall(match_href, citation) or [""])[0]
# RD = Referenced Document / AD = Applicable Document
......
......@@ -84,7 +84,7 @@ leaflet_display_svg = setToNone(kw.get('display_svg', "png"))
leaflet_download = setToNone(kw.get('document_download', None))
leaflet_save = setToNone(kw.get('document_save', None))
override_leaflet_header_title = kw.get('override_leaflet_header_title', None)
override_leaflet_header_title = setToNone(kw.get('override_leaflet_header_title', None))
override_source_person_title = kw.get('override_source_person_title', None)
override_source_organisation_title = kw.get(
"override_source_organisation_title",
......@@ -126,8 +126,11 @@ leaflet_theme = leaflet.Base_getThemeDict(
url=leaflet_url,
css_path="/leaflet_css/leaflet"
)
# set leaflet title, but not to theme (used elsewhere, but not on leaflet)
if override_leaflet_header_title is not None:
leaflet_theme["theme_logo_description"] = html_quote(override_leaflet_header_title)
if leaflet_theme.get("theme").lower() == leaflet_theme.get("theme_logo_description").lower():
leaflet_theme["theme_logo_description"] = blank
leaflet_recycle_url = ''.join([leaflet_url, "/leaflet_img/recycle.png?portal_skin=Leaflet"])
leaflet_css = ''.join([
'html .ci-leaflet #left-summary:before {',
......
......@@ -230,7 +230,7 @@ class TestCorporateIdentityTemplates(ERP5TypeTestCase):
"""
test_page = getattr(self.portal.web_page_module, id1)
expected_page = getattr(self.portal.web_page_module, id2)
dump = getattr(self.portal, 'dump_data')
dump = getattr(self.portal, 'dump_data', None)
kw["override_date"] = kw.get("override_date", test_page.getModificationDate())
html = getattr(test_page, kw.get("test_method"))(portal_skin=kw.get("use_skin"), **kw)
......@@ -248,7 +248,7 @@ class TestCorporateIdentityTemplates(ERP5TypeTestCase):
test_page = getattr(self.portal.web_page_module, id1)
expected_image = getattr(self.portal.image_module, id2)
image_source_pdf_doc = getattr(self.portal.document_module, id3)
dump = getattr(self.portal, 'dump_data')
dump = getattr(self.portal, 'dump_data', None)
kw["override_date"] = kw.get("override_date", test_page.getModificationDate())
pdf_kw = dict(
......
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