Commit ec3e785a authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_corporate_identity&test: fix citation incorrect error

parent 9a44f065
...@@ -156,19 +156,19 @@ if book_include_reference_table: ...@@ -156,19 +156,19 @@ if book_include_reference_table:
image_link_list = book.WebPage_createImageOverview(book_content) image_link_list = book.WebPage_createImageOverview(book_content)
for referenced_document in book_link_list.get("reference_list", []): for referenced_document in book_link_list.get("reference_list", []):
book_reference_list.append(referenced_document.get("item")) book_reference_list.append(referenced_document.get("item"))
book_content = book_content.replace(referenced_document.get("input"), referenced_document.get("output"),1) book_content = book_content.replace(referenced_document.get("input"), referenced_document.get("output"))
for applicable_document in book_link_list.get("applicable_list", []): for applicable_document in book_link_list.get("applicable_list", []):
book_applicable_document_list.append(applicable_document.get("item")) book_applicable_document_list.append(applicable_document.get("item"))
book_content = book_content.replace(applicable_document.get("input"), applicable_document.get("output"),1) book_content = book_content.replace(applicable_document.get("input"), applicable_document.get("output"))
for abbreviation in book_link_list.get("abbreviation_list", []): for abbreviation in book_link_list.get("abbreviation_list", []):
book_abbreviation_list.append(abbreviation.get("item")) book_abbreviation_list.append(abbreviation.get("item"))
book_content = book_content.replace(abbreviation.get("input"), abbreviation.get("output"),1) book_content = book_content.replace(abbreviation.get("input"), abbreviation.get("output"))
for figure in image_link_list.get("figure_list", []): for figure in image_link_list.get("figure_list", []):
book_image_list.append(figure.get("item")) book_image_list.append(figure.get("item"))
book_content = book_content.replace(figure.get("input"), figure.get("output"), 1) book_content = book_content.replace(figure.get("input"), figure.get("output"), 1)
for table in table_link_list.get("table_list", []): for table in table_link_list.get("table_list", []):
book_table_list.append(table.get("item")) book_table_list.append(table.get("item"))
book_content = book_content.replace(table.get("input"), table.get("output"), 1) book_content = book_content.replace(table.get("input"), table.get("output"))
# in order for the reference tables to be in the table of content, they must # in order for the reference tables to be in the table of content, they must
# be added beforehand to content # be added beforehand to content
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Image" 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>_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>6f858aff4a47a4f505f1391940cf1eaf</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>image/png</string> </value>
</item>
<item>
<key> <string>height</string> </key>
<value> <int>842</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>template_test_book_citation_bmp</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Image</string> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <int>595</int> </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>
</ZopeData>
<p>${WebPage_insertTableOfReferences}</p>
<h1>Test Citation</h1>
<p> TEST RD </p>
<p>Hello [<a href="http://www.nexedi.com" title="Nexedi">RD</a>]</p>
<p>Hello [<a href="http://www.nexedi.com" title="Nexedi">RD</a>]</p>
<p>Hello [<a href="http://www.nexedi.cn" title="Nexedi">RD</a>]</p>
<table align="center" border="1" cellpadding="1" cellspacing="1">
<caption>Companies, technologies and users</caption>
<thead>
<tr>
<th scope="col">Company</th>
<th scope="col">Country</th>
<th scope="col">Technology</th>
<th scope="col">Sample users</th>
</tr>
</thead>
</table>
<table align="center" border="1" cellpadding="1" cellspacing="1">
<caption>Companies, technologies and users</caption>
<thead>
<tr>
<th scope="col">Company</th>
<th scope="col">Country</th>
<th scope="col">Technology</th>
<th scope="col">Sample users</th>
</tr>
</thead>
</table>
<table align="center" border="1" cellpadding="1" cellspacing="1">
<caption>Company</caption>
<thead>
<tr>
<th scope="col">Company</th>
<th scope="col">Country</th>
</tr>
</thead>
</table>
<?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>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>id</string> </key>
<value> <string>template_test_book_citation_html</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Page</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -1644,6 +1644,24 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -1644,6 +1644,24 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
) )
) )
@changeSkin('Book')
def test_pdfBookCitation(self):
"""
"""
self.runPdfTestPattern(
"template_test_book_citation_html",
"template_test_book_citation_bmp",
"template_test_image_source_pdf",
**dict(
page_number=3,
use_skin="Book",
test_method="WebPage_exportAsBook",
format="pdf",
override_revision=1,
include_reference_table = 1
)
)
@changeSkin('Book') @changeSkin('Book')
def test_pdfBookPrint(self): def test_pdfBookPrint(self):
""" """
......
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