Commit eb6da0a4 authored by Sven Franck's avatar Sven Franck

erp5_corporate_identity: fix failing languages and update test files

parent a646e0e2
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts13676932.13</string> </value>
<value> <string>ts13722505.7</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>37124d8f30168b637379ff75a8c56096</string> </value>
<value> <string>b082265511e27ef7507e800e698e56bf</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts13676955.42</string> </value>
<value> <string>ts13722533.35</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>2bbd525d065612d63e5110e9db2a9e16</string> </value>
<value> <string>1c3a728cd854ed13659d8e79b85f3d7e</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts13676973.16</string> </value>
<value> <string>ts13722559.78</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -63,97 +63,6 @@
</tuple>
</value>
</item>
<item>
<key> <string>_content_information</string> </key>
<value>
<dictionary>
<item>
<key> <string>ArtBox</string> </key>
<value> <string>0.00 0.00 595.00 842.00</string> </value>
</item>
<item>
<key> <string>BleedBox</string> </key>
<value> <string>0.00 0.00 595.00 842.00</string> </value>
</item>
<item>
<key> <string>CreationDate</string> </key>
<value> <string>Tue Dec 19 10:49:28 2017</string> </value>
</item>
<item>
<key> <string>Creator</string> </key>
<value> <string>wkhtmltopdf 0.12.4</string> </value>
</item>
<item>
<key> <string>CropBox</string> </key>
<value> <string>0.00 0.00 595.00 842.00</string> </value>
</item>
<item>
<key> <string>Encrypted</string> </key>
<value> <string>no</string> </value>
</item>
<item>
<key> <string>File size</string> </key>
<value> <string>90286 bytes</string> </value>
</item>
<item>
<key> <string>Form</string> </key>
<value> <string>none</string> </value>
</item>
<item>
<key> <string>JavaScript</string> </key>
<value> <string>no</string> </value>
</item>
<item>
<key> <string>MediaBox</string> </key>
<value> <string>0.00 0.00 595.00 842.00</string> </value>
</item>
<item>
<key> <string>Optimized</string> </key>
<value> <string>no</string> </value>
</item>
<item>
<key> <string>PDF version</string> </key>
<value> <string>1.4</string> </value>
</item>
<item>
<key> <string>Page rot</string> </key>
<value> <string>0</string> </value>
</item>
<item>
<key> <string>Page size</string> </key>
<value> <string>595 x 842 pts (A4)</string> </value>
</item>
<item>
<key> <string>Pages</string> </key>
<value> <string>6</string> </value>
</item>
<item>
<key> <string>Producer</string> </key>
<value> <string>Qt 4.8.7</string> </value>
</item>
<item>
<key> <string>Suspects</string> </key>
<value> <string>no</string> </value>
</item>
<item>
<key> <string>Tagged</string> </key>
<value> <string>no</string> </value>
</item>
<item>
<key> <string>Title</string> </key>
<value> <string>Template Test Book</string> </value>
</item>
<item>
<key> <string>TrimBox</string> </key>
<value> <string>0.00 0.00 595.00 842.00</string> </value>
</item>
<item>
<key> <string>UserProperties</string> </key>
<value> <string>no</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>_count</string> </key>
<value>
......@@ -174,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>cd1fdc9a1c66e4f4fef4ee72f7ccdfe3</string> </value>
<value> <string>d6478bedc23c668b1996b6523c02318f</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts13613347.45</string> </value>
<value> <string>ts13722370.96</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>f44fd6bbfc1134c1e163877850498a92</string> </value>
<value> <string>37664a694b348e215bb96710822232b6</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts13613366.64</string> </value>
<value> <string>ts13722391.78</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>dc714ca1b094b6c6a3cc58ee785e074b</string> </value>
<value> <string>7691e9098983a1309a0a2ad1d0f4dec8</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts13613382.95</string> </value>
<value> <string>ts13722410.76</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>030754bd8476c4eabf6cf043a1e78da4</string> </value>
<value> <string>107e356232e572912cae0196acfc4716</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts13613210.61</string> </value>
<value> <string>ts13722205.21</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>f2954da5c4323cce454bd195539fd478</string> </value>
<value> <string>8f5f7281daac07858170b95aa47bdd86</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts13613230.0</string> </value>
<value> <string>ts13722226.89</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>328f91e1032279c03454bd54064f0a19</string> </value>
<value> <string>a5c640a150ff808e2519e1fb29f6c28d</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts13613247.48</string> </value>
<value> <string>ts13722250.31</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>77ab1aceca7d8aaff596ff73814c3132</string> </value>
<value> <string>107b3c4889b4c79d7fc1d099ebc513cb</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts13613265.62</string> </value>
<value> <string>ts13722271.94</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>a7ba1842285fbaea96c7fad464a1acd9</string> </value>
<value> <string>b9903f7443e5849605f8bba3deccb376</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts13613032.47</string> </value>
<value> <string>ts13721849.98</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>31a817d207c0fc7467e3feaec16bb914</string> </value>
<value> <string>2bcd458cf554ba9f28f86290e194d182</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts13613066.19</string> </value>
<value> <string>ts13721889.26</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>60dd6c28a7e8d4cf3c849ae699e517bc</string> </value>
<value> <string>ca55222f8d723027186748a9d7769fa4</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts13613085.33</string> </value>
<value> <string>ts13721912.27</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>76eed85ccefab3ce0bd7388d0431b70c</string> </value>
<value> <string>806ffe636dbc47b19b918052c7297936</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts13613050.28</string> </value>
<value> <string>ts13721868.75</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>426b46e06ec0e98525b00b292073f119</string> </value>
<value> <string>25ffde2e3c542ef9b5ef811376fa80f9</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts13613109.22</string> </value>
<value> <string>ts13721936.22</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>5e046142ddc53481c2983f1d06b5e99e</string> </value>
<value> <string>e3eb482db03a11c678246a45d266f500</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
......@@ -30,7 +30,7 @@
<div class="ci-leaflet-header">
<p class="ci-leaflet-source-header">:</p>
<p class="ci-leaflet-sheet-header">Data Sheet</p>
<p class="ci-leaflet-sheet-header">Datenblatt</p>
</div>
......
......@@ -187,7 +187,7 @@ mi aliquet a praesent ante orci accumsan magna neque.
<span class="ci-letter-footer-title">Telephone</span><span></span>
<span class="ci-letter-footer-title">Telefax</span><span></span>
<span class="ci-letter-footer-title">Email</span><span>author@test-organisation.com</span>
<span class="ci-letter-footer-title">Web Adress</span><span></span>
<span class="ci-letter-footer-title">Web Adresse</span><span></span>
</div>
</td>
<td>
......@@ -195,7 +195,7 @@ mi aliquet a praesent ante orci accumsan magna neque.
<span class="ci-letter-footer-title">Bank Account</span><span></span>
<span class="ci-letter-footer-title">BIC</span><span></span>
<span class="ci-letter-footer-title">IBAN</span><span></span>
<span class="ci-letter-footer-title">VAT ID</span><span></span>
<span class="ci-letter-footer-title">USt-ID</span><span></span>
<span class="ci-letter-footer-title">Siren</span><span></span>
</div>
</td>
......
......@@ -49,8 +49,7 @@ theme = (
custom_theme or
default_company_title
)
#if theme and override_batch_mode:
# theme = "default"
if theme is not None:
logo_prefix = getCustomParameter("default_logo_prefix", None)
theme = theme.lower()
......
......@@ -60,7 +60,7 @@ for header in re.findall("<h[1-6].*?</h[1-6]>", doc_content or blank):
closer = int(header_current) * '</ol>'
insert = ''.join([
'<section class="ci-book-table-of-content">',
'<p class="ci-book-toc-faux-h1">%s</p>' % (doc_toc_title or "XXX"),
'<p class="ci-book-toc-faux-h1">%s</p>' % (doc_toc_title or "Table of Contents"),
table_of_content,
closer,
'</section>'
......
......@@ -125,8 +125,10 @@ doc_short_date = doc_modification_date.strftime('%Y-%m-%d')
if override_batch_mode is not None:
doc_modification_date = DateTime("1976-11-04")
doc_revision = "1"
if doc_language and doc_format == "pdf":
if doc_language is not None: # and doc_format == "pdf":
doc.REQUEST['AcceptLanguage'].set(doc_language, 10)
if doc_language is None:
doc_language = blank
if doc_reference is blank:
doc_reference = "Report." + doc_title.replace(" ", ".")
doc_full_reference = '-'.join([doc_reference, doc_version, doc_language])
......
......@@ -132,7 +132,7 @@ book_short_title = setOverrideParam(book, override_document_short_title, "short_
book_version = setOverrideParam(book, override_document_version, "version")
book_description = setOverrideParam(book, override_document_description, "description")
book_content = book.getTextContent()
book_language = book.getLanguage()
book_language = setToNone(book.getLanguage())
book_aggregate_list = []
book_absolute_url = book.getAbsoluteUrl()
book_reference = (html_quote(override_document_reference) if override_document_reference else book.getReference()) or blank
......@@ -143,8 +143,10 @@ if override_batch_mode is not None:
book_modification_date = DateTime("1976-11-04")
book_revision = "1"
book_short_date = book_modification_date.strftime('%Y-%m-%d')
if book_language and book_format == "pdf":
if book_language is not None: #and book_format == "pdf":
book.REQUEST['AcceptLanguage'].set(book_language, 10)
if book_language is None:
book_language = blank
if book_reference is None:
book_reference = book_prefix + book_title.replace(" ", ".")
book_full_reference = '-'.join([book_reference, book_version, book_language])
......
......@@ -106,7 +106,7 @@ leaflet_url = leaflet.getAbsoluteUrl()
leaflet_content = leaflet.getTextContent()
leaflet_title = leaflet.getTitle()
leaflet_relative_url = leaflet.getRelativeUrl()
leaflet_language = leaflet.getLanguage()
leaflet_language = setToNone(leaflet.getLanguage())
leaflet_description = leaflet.getDescription()
leaflet_creation_date = leaflet.getCreationDate()
leaflet_date = leaflet_creation_date.strftime('%Y-%b')
......@@ -122,8 +122,10 @@ leaflet_modification_date = leaflet.getModificationDate()
if override_batch_mode is not None:
leaflet_date="Nov-1976"
leaflet_year="1976"
if leaflet_language and leaflet_format == "pdf":
if leaflet_language is not None: #and leaflet_format == "pdf":
leaflet.REQUEST['AcceptLanguage'].set(leaflet_language, 10)
if leaflet_language is None:
leaflet_language = blank
if leaflet_reference is None:
leaflet_reference = leaflet_prefix + leaflet_title.replace(" ", ".")
leaflet_full_reference = '-'.join([leaflet_reference, leaflet_version, leaflet_language])
......
......@@ -105,7 +105,7 @@ if letter_portal_type == "Web Page":
letter_title = letter.getTitle()
letter_modification_date = DateTime(override_date) if override_date else letter.getCreationDate()
letter_content = letter.getTextContent()
letter_language = letter.getLanguage()
letter_language = setToNone(letter.getLanguage())
letter_aggregate_list = []
letter_source = None
letter_destination = None
......@@ -120,7 +120,7 @@ else:
letter_title = letter_form.get('title')
letter_content = letter_form.get('text_content')
letter_aggregate_list = letter.getAggregateList()
letter_language = letter_form.get('select_language')
letter_language = setToNone(letter_form.get('select_language'))
letter_source = letter_form.get('source') or None
letter_destination = letter_form.get('destination') or None
# cut corner to retrieve path to css files
......@@ -131,8 +131,10 @@ else:
if override_batch_mode is not None:
letter_modification_date = DateTime("1976-11-04")
if letter_language and letter_format == "pdf":
if letter_language is not None: #and letter_format == "pdf":
letter.REQUEST['AcceptLanguage'].set(letter_language, 10)
if letter_language is None:
letter_language = blank
if letter_reference is None:
letter_reference = letter_prefix + letter_title.replace(" ", ".")
letter_full_reference = '-'.join([letter_reference, letter_version, letter_language])
......
......@@ -224,7 +224,7 @@ doc_uid = doc.getUid()
doc_dirty_content = doc_converted_content or doc.getTextContent()
doc_content = removeEmptyDetails(doc_dirty_content)
doc_title = doc.getTitle()
doc_language = doc.getLanguage()
doc_language = setToNone(doc.getLanguage())
doc_description = doc.getDescription()
doc_creation_year = doc.getCreationDate().strftime('%Y')
doc_version = doc.getVersion() or "001"
......@@ -236,8 +236,10 @@ doc_modification_date = doc.getModificationDate()
if override_batch_mode is not None:
doc_version = "001"
doc_creation_year = "1976"
if doc_language and doc_format == "pdf":
if doc_language is not None: #and doc_format == "pdf":
doc.REQUEST['AcceptLanguage'].set(doc_language, 10)
if doc_language is None:
doc_language = blank
if doc_reference is None:
doc_reference = doc_prefix + doc_title.replace(" ", ".")
doc_full_reference = '-'.join([doc_reference, doc_version, doc_language])
......
......@@ -106,8 +106,8 @@ class TestCorporateIdentityTemplates(ERP5TypeTestCase):
self.message_catalog.message_edit('VAT ID', 'de', 'USt-ID', '')
self.message_catalog.gettext('Data Sheet', add=1)
self.message_catalog.message_edit('Data Sheet', 'de', 'Datenblatt', '')
self.message_catalog.gettext('Table Of Contents', add=1)
self.message_catalog.message_edit('Table Of Contents', 'de', 'Inhaltsverzeichnis', '')
self.message_catalog.gettext('Table of Contents', add=1)
self.message_catalog.message_edit('Table of Contents', 'de', 'Inhaltsverzeichnis', '')
# Activating a system preference if none is activated
for preference in self.portal.portal_catalog(portal_type="System Preference"):
......@@ -238,7 +238,14 @@ class TestCorporateIdentityTemplates(ERP5TypeTestCase):
dump = getattr(self.portal, 'dump_data', None)
kw["batch_mode"] = 1
html = getattr(test_page, kw.get("test_method"))(portal_skin=kw.get("use_skin"), **kw)
#html = getattr(test_page, kw.get("test_method"))(portal_skin=kw.get("use_skin"), **kw)
html = self.call(
self.callWithNewRequestAcceptLanguage,
self.callWithNewRequestForm,
dict(),
getattr(test_page, kw.get("test_method")),
**kw
)
html = re.sub(host_url, test_url, html)
# update html test files or run tests
......
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