Commit 30f6a357 authored by Arnaud Fontaine's avatar Arnaud Fontaine

WIP: ZODB Components: erp5_web: Migrate Documents and Unit Tests (MR !1219).

* WebSection in erp5_base rather than erp5_base because WebSection_ prefix
  is used here and there (CodingStyleTest).
* Properly override WebSite Document in erp5_web_shadir by creating a new
  version_priority.
parent ba7f2857
......@@ -2,10 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="WebSite" module="Products.ERP5.Document.WebSite"/>
<tuple/>
</tuple>
<global name="Web Site" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......@@ -244,10 +241,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="WebSiteTraversalHook" module="Products.ERP5.Document.WebSite"/>
<tuple/>
</tuple>
<global name="WebSiteTraversalHook" module="erp5.component.document.erp5_version.WebSite"/>
</pickle>
<pickle>
<dictionary/>
......
erp5_web
\ No newline at end of file
......@@ -676,7 +676,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSiteTraversalHook" module="Products.ERP5.Document.WebSite"/>
<global name="WebSiteTraversalHook" module="erp5.component.document.WebSite"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -260,7 +260,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -294,7 +294,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -171,7 +171,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -171,7 +171,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -266,7 +266,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -228,7 +228,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -277,7 +277,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -294,7 +294,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -185,7 +185,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -220,7 +220,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -170,7 +170,7 @@ class WebSection(Domain, DocumentExtensibleTraversableMixin):
# unregister all before traversal hooks that do not belong to us.
my_handle = self.meta_type + '/' + self.getId()
handle_to_unregister_list = []
for (priority, handle), hook in self.__before_traverse__.items():
for (_, handle), hook in self.__before_traverse__.items():
if isinstance(hook, self._getTraversalHookClass()) and handle != my_handle:
handle_to_unregister_list.append(handle)
for handle in handle_to_unregister_list:
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Document Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>WebSection</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.Document.WebSection</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>document.erp5.WebSection</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Document 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/>
</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">AAAAAAAAAAI=</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>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -50,3 +50,4 @@ document.erp5.TitleMovementGroup
document.erp5.Url
document.erp5.VariantMovementGroup
document.erp5.VariationPropertyMovementGroup
document.erp5.WebSection
\ No newline at end of file
......@@ -315,7 +315,7 @@ function/company/executive</string> </value>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSiteTraversalHook" module="Products.ERP5.Document.WebSite"/>
<global name="WebSiteTraversalHook" module="erp5.component.document.WebSite"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -70,7 +70,6 @@ class TestERP5WebWithCRM(ERP5TypeTestCase):
"""
Setup Web Site
"""
portal = self.getPortal()
website = self.getPortal().web_site_module.newContent(portal_type='Web Site',
**kw)
websection = website.newContent(portal_type='Web Section', **kw)
......@@ -145,7 +144,6 @@ class TestERP5WebWithCRM(ERP5TypeTestCase):
web_section.WebSection_addWebMessage(**form_kw)
transaction.commit()
# here we check a random bug caused by the ordering of activities
should_stop = [None]
event_module_path_prefix = self.portal.event_module.getPath() + '/'
deprioritize_message_list = []
# we'll stop whenever we find the message that reindex the newly created
......@@ -159,7 +157,8 @@ class TestERP5WebWithCRM(ERP5TypeTestCase):
return True
return False
self.tic(stop_condition=stop_condition)
web_message_reindex_message, = deprioritize_message_list
assert len(deprioritize_message_list) == 1
web_message_reindex_message = deprioritize_message_list[0]
web_message_path = web_message_reindex_message.object_path
self.assertTrue(
self.portal.unrestrictedTraverse(web_message_path).getPortalType(),
......
<?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>default_reference</string> </key>
<value> <string>testERP5WebWithCRM</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.tests.testERP5WebWithCRM</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testERP5WebWithCRM</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/>
</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">AAAAAAAAAAI=</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>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
test.erp5.testCRMNotificationTool
test.erp5.testCRMSupportRequest
test.erp5.testERP5WebWithCRM
\ No newline at end of file
erp5_full_text_mroonga_catalog
erp5_core_test
erp5_web
\ No newline at end of file
......@@ -496,7 +496,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSiteTraversalHook" module="Products.ERP5.Document.WebSite"/>
<global name="WebSiteTraversalHook" module="erp5.component.document.WebSite"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -317,7 +317,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSiteTraversalHook" module="Products.ERP5.Document.WebSite"/>
<global name="WebSiteTraversalHook" module="erp5.component.document.WebSite"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -185,7 +185,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -458,7 +458,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSiteTraversalHook" module="Products.ERP5.Document.WebSite"/>
<global name="WebSiteTraversalHook" module="erp5.component.document.WebSite"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -298,7 +298,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSiteTraversalHook" module="Products.ERP5.Document.WebSite"/>
<global name="WebSiteTraversalHook" module="erp5.component.document.WebSite"/>
</pickle>
<pickle>
<dictionary/>
......@@ -306,7 +306,7 @@
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WebSiteTraversalHook" module="Products.ERP5.Document.WebSite"/>
<global name="WebSiteTraversalHook" module="erp5.component.document.WebSite"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -221,7 +221,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -171,7 +171,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -213,7 +213,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -179,7 +179,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -287,7 +287,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSiteTraversalHook" module="Products.ERP5.Document.WebSite"/>
<global name="WebSiteTraversalHook" module="erp5.component.document.WebSite"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -230,7 +230,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -536,7 +536,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSiteTraversalHook" module="Products.ERP5.Document.WebSite"/>
<global name="WebSiteTraversalHook" module="erp5.component.document.WebSite"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -465,7 +465,7 @@ WebSection_getBookmarkManagerPrecacheManifestList</string> </value>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -564,7 +564,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSiteTraversalHook" module="Products.ERP5.Document.WebSite"/>
<global name="WebSiteTraversalHook" module="erp5.component.document.WebSite"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -510,7 +510,7 @@ WebSection_getCodemirrorEditorPrecacheManifestList</string> </value>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -183,7 +183,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -522,7 +522,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSiteTraversalHook" module="Products.ERP5.Document.WebSite"/>
<global name="WebSiteTraversalHook" module="erp5.component.document.WebSite"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -390,7 +390,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -536,7 +536,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSiteTraversalHook" module="Products.ERP5.Document.WebSite"/>
<global name="WebSiteTraversalHook" module="erp5.component.document.WebSite"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -440,7 +440,7 @@ WebSection_getDriveAppPrecacheManifestList</string> </value>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -236,7 +236,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -183,7 +183,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -345,7 +345,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSiteTraversalHook" module="Products.ERP5.Document.WebSite"/>
<global name="WebSiteTraversalHook" module="erp5.component.document.WebSite"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -536,7 +536,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSiteTraversalHook" module="Products.ERP5.Document.WebSite"/>
<global name="WebSiteTraversalHook" module="erp5.component.document.WebSite"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -515,7 +515,7 @@ WebSection_getMediaPlayerPrecacheManifestList</string> </value>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -536,7 +536,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSiteTraversalHook" module="Products.ERP5.Document.WebSite"/>
<global name="WebSiteTraversalHook" module="erp5.component.document.WebSite"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -477,7 +477,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -550,7 +550,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSiteTraversalHook" module="Products.ERP5.Document.WebSite"/>
<global name="WebSiteTraversalHook" module="erp5.component.document.WebSite"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -541,7 +541,7 @@ WebSection_getPDFViewerPrecacheManifestList</string> </value>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -183,7 +183,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -550,7 +550,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSiteTraversalHook" module="Products.ERP5.Document.WebSite"/>
<global name="WebSiteTraversalHook" module="erp5.component.document.WebSite"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -492,7 +492,7 @@ WebSection_getSmartAssistantPrecacheManifestList</string> </value>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -550,7 +550,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSiteTraversalHook" module="Products.ERP5.Document.WebSite"/>
<global name="WebSiteTraversalHook" module="erp5.component.document.WebSite"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -525,7 +525,7 @@ WebSection_getSvgEditorPrecacheManifestList</string> </value>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -183,7 +183,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -550,7 +550,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSiteTraversalHook" module="Products.ERP5.Document.WebSite"/>
<global name="WebSiteTraversalHook" module="erp5.component.document.WebSite"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -466,7 +466,7 @@ WebSection_getTextEditorPrecacheManifestList</string> </value>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -183,7 +183,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -436,7 +436,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSiteTraversalHook" module="Products.ERP5.Document.WebSite"/>
<global name="WebSiteTraversalHook" module="erp5.component.document.WebSite"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -536,7 +536,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSiteTraversalHook" module="Products.ERP5.Document.WebSite"/>
<global name="WebSiteTraversalHook" module="erp5.component.document.WebSite"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -437,7 +437,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -287,7 +287,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSiteTraversalHook" module="Products.ERP5.Document.WebSite"/>
<global name="WebSiteTraversalHook" module="erp5.component.document.WebSite"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -462,7 +462,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSiteTraversalHook" module="Products.ERP5.Document.WebSite"/>
<global name="WebSiteTraversalHook" module="erp5.component.document.WebSite"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -236,7 +236,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSiteTraversalHook" module="Products.ERP5.Document.WebSite"/>
<global name="WebSiteTraversalHook" module="erp5.component.document.WebSite"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -393,7 +393,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -278,7 +278,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -191,7 +191,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -222,7 +222,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -249,7 +249,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -286,7 +286,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -269,7 +269,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -204,7 +204,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -550,7 +550,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSiteTraversalHook" module="Products.ERP5.Document.WebSite"/>
<global name="WebSiteTraversalHook" module="erp5.component.document.WebSite"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -573,7 +573,7 @@ WebSection_getImageEditorPrecacheManifestList</string> </value>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -183,7 +183,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -550,7 +550,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSiteTraversalHook" module="Products.ERP5.Document.WebSite"/>
<global name="WebSiteTraversalHook" module="erp5.component.document.WebSite"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -525,7 +525,7 @@ WebSection_getWebTableEditorPrecacheManifestList</string> </value>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -183,7 +183,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -542,7 +542,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSiteTraversalHook" module="Products.ERP5.Document.WebSite"/>
<global name="WebSiteTraversalHook" module="erp5.component.document.WebSite"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -526,7 +526,7 @@ WebSection_getOOfficePresentationEditorPrecacheManifestList</string> </value>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -183,7 +183,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -542,7 +542,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSiteTraversalHook" module="Products.ERP5.Document.WebSite"/>
<global name="WebSiteTraversalHook" module="erp5.component.document.WebSite"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -560,7 +560,7 @@ WebSection_getOOfficeSpreadsheetEditorPrecacheManifestList</string> </value>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -183,7 +183,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -536,7 +536,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSiteTraversalHook" module="Products.ERP5.Document.WebSite"/>
<global name="WebSiteTraversalHook" module="erp5.component.document.WebSite"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -526,7 +526,7 @@ WebSection_getOOfficeTextEditorPrecacheManifestList</string> </value>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -183,7 +183,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -508,7 +508,7 @@ WebSection_getOfficeJSSupportRequestPrecacheManifestList</string> </value>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSiteTraversalHook" module="Products.ERP5.Document.WebSite"/>
<global name="WebSiteTraversalHook" module="erp5.component.document.WebSite"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -282,7 +282,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -195,7 +195,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -222,7 +222,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -470,7 +470,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSiteTraversalHook" module="Products.ERP5.Document.WebSite"/>
<global name="WebSiteTraversalHook" module="erp5.component.document.WebSite"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -348,7 +348,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -185,7 +185,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
<global name="WebSectionTraversalHook" module="erp5.component.document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
......
......@@ -32,7 +32,7 @@ from Acquisition import aq_base
from OFS.Traversable import NotFound
from Products.ERP5.mixin.document_extensible_traversable import DocumentExtensibleTraversableMixin
from Products.ERP5.Document.WebSection import WebSection
from erp5.component.document.WebSection import WebSection
from Products.ERP5Type import Permissions
from webdav.NullResource import NullResource
......
......@@ -27,14 +27,11 @@
from AccessControl import ClassSecurityInfo
from Products.ERP5.Document.WebSection import WebSection
from Products.ERP5.Document.WebSection import WebSectionTraversalHook
from erp5.component.document.WebSection import WebSection, WebSectionTraversalHook
from Products.ERP5Type import Permissions, PropertySheet
from Products.ERP5Type.Cache import CachingMethod
from Products.ERP5Type.Globals import get_request
from Persistence import Persistent
from ZPublisher import BeforeTraverse
from ZPublisher.HTTPRequest import HTTPRequest
from warnings import warn
from zExceptions import Redirect
......@@ -161,7 +158,6 @@ class WebSite(WebSection):
"""
Returns the current web site (ie. self) though containment acquisition
"""
return self
# Static Language Selection support
......@@ -223,7 +219,7 @@ class WebSite(WebSection):
all documents in each of them to build a reverse
mapping of getPermanentURL
"""
return map(lambda x:x.getPermanentURL(document), self.getWebSectionValueList(document))
return [x.getPermanentURL(document) for x in self.getWebSectionValueList(document)]
security.declareProtected(Permissions.AccessContentsInformation, 'getWebSectionValueList')
def getWebSectionValueList(self, document):
......@@ -276,4 +272,3 @@ class WebSite(WebSection):
return section_list
else:
return []
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Document Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>WebSite</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.Document.WebSite</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>document.erp5.WebSite</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Document 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: 70, 4: Redefining built-in \'select_language\' (redefined-builtin)</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">AAAAAAAAAAI=</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>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -109,7 +109,7 @@ class TestWebSiteTraversalHook(WebTraversalHookTestMixin, ERP5TypeTestCase):
self.web_section = self.portal.web_site_module.newContent(
portal_type='Web Site',
)
from Products.ERP5Type.Document.WebSite import WebSiteTraversalHook
from erp5.component.document.WebSite import WebSiteTraversalHook
self.traversal_hook_class = WebSiteTraversalHook
......@@ -121,7 +121,7 @@ class TestWebSectionTraversalHook(WebTraversalHookTestMixin, ERP5TypeTestCase):
)
self.web_section = web_site.newContent(portal_type='Web Section')
from Products.ERP5Type.Document.WebSection import WebSectionTraversalHook
from erp5.component.document.WebSection import WebSectionTraversalHook
self.traversal_hook_class = WebSectionTraversalHook
......@@ -248,7 +248,7 @@ class TestERP5Web(ERP5TypeTestCase):
portal_catalog = self.getCatalogTool()
try:
portal_catalog.catalog_object(web_site)
except:
except Exception:
self.fail('Cataloging of the Web Site failed.')
......@@ -346,10 +346,10 @@ Hé Hé Hé!""", page.asText().strip())
current user selected language in browser.
"""
portal = self.getPortal()
website = self.setupWebSite()
self.setupWebSite()
websection = self.setupWebSection()
page_reference = 'default-webpage'
webpage_list = self.setupWebSitePages(prefix=page_reference)
self.setupWebSitePages(prefix=page_reference)
# set default web page for section
found_by_reference = portal.portal_catalog(reference=page_reference,
......@@ -420,7 +420,7 @@ Hé Hé Hé!""", page.asText().strip())
Note: due to generic ERP5 Web implementation this test highly depends
on WebSection_geDefaulttDocumentValueList
"""
website = self.setupWebSite()
self.setupWebSite()
websection = self.setupWebSection()
publication_section_category_id_list = ['documentation', 'administration']
......@@ -487,7 +487,7 @@ Hé Hé Hé!""", page.asText().strip())
""" Check getting getDocumentValueList from Web Section.
"""
portal = self.getPortal()
website = self.setupWebSite()
self.setupWebSite()
websection = self.setupWebSection()
publication_section_category_id_list = ['documentation', 'administration']
......@@ -717,7 +717,7 @@ Hé Hé Hé!""", page.asText().strip())
web_page_list = self.setupWebSitePages('test1',
language_list=('en',),
publication_section_list=('my_test_category',))
web_page_list2 = self.setupWebSitePages('test2',
self.setupWebSitePages('test2',
language_list=('en',),
publication_section_list=('my_test_category',))
......@@ -1091,10 +1091,9 @@ Hé Hé Hé!""", page.asText().strip())
request['PARENTS'] = [self.app]
website = self.setupWebSite()
web_section_portal_type = 'Web Section'
web_section = website.newContent(portal_type=web_section_portal_type)
website.newContent(portal_type=web_section_portal_type)
content = '<p>initial text</p>'
new_content = '<p>modified text<p>'
document = portal.web_page_module.newContent(portal_type='Web Page',
id='document_original_cache',
reference='NXD-Document.Cache',
......@@ -1234,7 +1233,7 @@ Hé Hé Hé!""", page.asText().strip())
self.login()
self.tic()
web_site = self.setupWebSite()
self.setupWebSite()
websection = self.setupWebSection()
websection_url = '%s/%s' % (self.portal.getId(), websection.getRelativeUrl())
......@@ -1263,7 +1262,7 @@ Hé Hé Hé!""", page.asText().strip())
"""
website = self.setupWebSite()
web_section_portal_type = 'Web Section'
web_section = website.newContent(portal_type=web_section_portal_type)
website.newContent(portal_type=web_section_portal_type)
content = '<p>initial text</p>'
document = self.portal.web_page_module.newContent(portal_type='Web Page',
......@@ -1320,7 +1319,6 @@ Hé Hé Hé!""", page.asText().strip())
request['PARENTS'] = [self.app]
website = self.setupWebSite()
path = website.absolute_url_path() + '/a_non_existing_page'
absolute_url = website.absolute_url() + '/a_non_existing_page'
request = portal.REQUEST
# Check a Not Found page is returned
......@@ -1475,10 +1473,7 @@ Hé Hé Hé!""", page.asText().strip())
"""
Test Web Site map script.
"""
request = self.app.REQUEST
website = self.setupWebSite()
kw = {'depth': 5,
'include_subsection': 1}
website.setSiteMapSectionParent(1)
websection1 = website.newContent(portal_type='Web Section',
......@@ -1601,7 +1596,7 @@ class TestERP5WebWithSimpleSecurity(ERP5TypeTestCase):
def getTitle(self):
return "Web"
def createUser(self, name, role_list):
def createUser(self, name, role_list): # pylint: disable=arguments-differ
user_folder = self.getPortal().acl_users
user_folder._doAddUser(name, 'password', role_list, [])
......@@ -1875,7 +1870,7 @@ class TestERP5WebWithSimpleSecurity(ERP5TypeTestCase):
# test for admin
try:
site_1 = web_site_module.newContent(portal_type='Web Site', id='site_1')
web_site_module.newContent(portal_type='Web Site', id='site_1')
except Unauthorized:
self.fail("Admin should be able to create a Web Site.")
......@@ -1927,7 +1922,7 @@ class TestERP5WebWithSimpleSecurity(ERP5TypeTestCase):
# test for admin
try:
base_category_1 = portal_categories.newContent(portal_type='Base Category', id='base_category_1')
portal_categories.newContent(portal_type='Base Category', id='base_category_1')
except Unauthorized:
self.fail("Admin should be able to create a Base Category.")
try:
......@@ -1947,7 +1942,7 @@ class TestERP5WebWithSimpleSecurity(ERP5TypeTestCase):
# test as a web user (assignor)
self.loginByUserName('webmaster')
try:
base_category_2 = portal_categories.newContent(portal_type='Base Category', id='base_category_2')
portal_categories.newContent(portal_type='Base Category', id='base_category_2')
self.fail("A webmaster should not be able to create a Base Category.")
except Unauthorized:
pass
......@@ -1981,7 +1976,7 @@ class TestERP5WebWithSimpleSecurity(ERP5TypeTestCase):
# test for admin
try:
new_base_category_1 = portal_categories.newContent(portal_type='Base Category', id='new_base_category_1')
portal_categories.newContent(portal_type='Base Category', id='new_base_category_1')
except Unauthorized:
self.fail("Admin should be able to create a Base Category.")
try:
......@@ -1992,14 +1987,14 @@ class TestERP5WebWithSimpleSecurity(ERP5TypeTestCase):
self.fail("Admin should be able to create a Category.")
self.tic()
try:
new_cat_1_renamed = new_category_1.edit(id='new_cat_1_renamed')
new_cat_2_renamed = new_category_2.edit(id='new_cat_2_renamed')
new_category_1.edit(id='new_cat_1_renamed')
new_category_2.edit(id='new_cat_2_renamed')
except Unauthorized:
self.fail("Admin should be able to rename a Category.")
# test as a web user (assignor)
self.loginByUserName('webmaster')
try:
base_category_2 = portal_categories.newContent(portal_type='Base Category', id='base_category_2')
portal_categories.newContent(portal_type='Base Category', id='base_category_2')
self.fail("A webmaster should not be able to create a Base Category.")
except Unauthorized:
pass
......@@ -2012,8 +2007,8 @@ class TestERP5WebWithSimpleSecurity(ERP5TypeTestCase):
self.fail("A webmaster should be able to create a Category.")
self.tic()
try:
new_cat_3_renamed = new_category_3.edit(id='new_cat_3_renamed')
new_cat_4_renamed = new_category_4.edit(id='new_cat_4_renamed')
new_category_3.edit(id='new_cat_3_renamed')
new_category_4.edit(id='new_cat_4_renamed')
except Unauthorized:
self.fail("A webmaster should be able to rename a Category.")
......@@ -2162,7 +2157,7 @@ class ERP5WebUpgraderMixin(object):
class TestERP5WebSiteUpgrader(ERP5WebUpgraderMixin, ERP5TypeTestCase):
def afterSetUp(self):
super(ERP5WebUpgraderMixin, self).afterSetUp()
super(TestERP5WebSiteUpgrader, self).afterSetUp()
self.upgraded = self.portal.web_site_module.newContent(
portal_type='Web Site',
)
......@@ -2170,7 +2165,7 @@ class TestERP5WebSiteUpgrader(ERP5WebUpgraderMixin, ERP5TypeTestCase):
class TestERP5WebSectionUpgrader(ERP5WebUpgraderMixin, ERP5TypeTestCase):
def afterSetUp(self):
super(ERP5WebUpgraderMixin, self).afterSetUp()
super(TestERP5WebSectionUpgrader, self).afterSetUp()
self.upgraded = self.portal.web_site_module.newContent(
portal_type='Web Site',
).newContent(
......@@ -2179,7 +2174,7 @@ class TestERP5WebSectionUpgrader(ERP5WebUpgraderMixin, ERP5TypeTestCase):
class TestERP5StaticWebSiteUpgrader(ERP5WebUpgraderMixin, ERP5TypeTestCase):
def afterSetUp(self):
super(ERP5WebUpgraderMixin, self).afterSetUp()
super(TestERP5StaticWebSiteUpgrader, self).afterSetUp()
self.upgraded = self.portal.web_site_module.newContent(
portal_type='Static Web Site',
)
......@@ -2187,7 +2182,7 @@ class TestERP5StaticWebSiteUpgrader(ERP5WebUpgraderMixin, ERP5TypeTestCase):
class TestERP5StaticWebSectionUpgrader(ERP5WebUpgraderMixin, ERP5TypeTestCase):
def afterSetUp(self):
super(ERP5WebUpgraderMixin, self).afterSetUp()
super(TestERP5StaticWebSectionUpgrader, self).afterSetUp()
self.upgraded = self.portal.web_site_module.newContent(
portal_type='Web Site',
).newContent(
......
<?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>default_reference</string> </key>
<value> <string>testERP5Web</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.tests.testERP5Web</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testERP5Web</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/>
</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">AAAAAAAAAAI=</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>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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