Commit 4558c52d authored by Jérome Perrin's avatar Jérome Perrin

Make coding style install less business templates

Move `BusinessTemplate_getPythonSourceCodeMessageList` to `erp5_core`, so that coding style tests don't need to install `erp5_administration` and all its dependencies.

`erp5_core` is not the final place for this, because this is not required to for business template bootstrap, but this is temporary until we finish business template reorganisation.

This revealed several problems of wrong dependencies between business templates that we could not see before, when coding style was installing too many business templates such as `erp5_pdm`, `erp5_trade`, `erp5_simulation`, `erp5_project`.

See merge request !1089
parents b78241cd 1c05093c
Pipeline #8696 passed with stage
erp5_base >= 0.8.3
erp5_core >= 1.0rc13
erp5_simulation
\ No newline at end of file
......@@ -173,52 +173,6 @@ def checkConversionToolAvailability(self):
result.edit(severity=severity)
active_process.postResult(result)
from Products.ERP5Type.Utils import checkPythonSourceCode
def checkPythonSourceCodeAsJSON(self, data, REQUEST=None):
"""
Check Python source suitable for Source Code Editor and return a JSON object
"""
import json
# XXX data is encoded as json, because jQuery serialize lists as []
if isinstance(data, basestring):
data = json.loads(data)
# data contains the code, the bound names and the script params. From this
# we reconstruct a function that can be checked
def indent(text):
return ''.join((" " + line) for line in text.splitlines(True))
is_python_script = 'bound_names' in data
if is_python_script:
signature_parts = data['bound_names']
if data['params']:
signature_parts += [data['params']]
signature = ", ".join(signature_parts)
function_name = "function_name"
body = "def %s(%s):\n%s" % (function_name,
signature,
indent(data['code']) or " pass")
else:
body = data['code']
message_list = checkPythonSourceCode(body.encode('utf8'), data.get('portal_type'))
for message_dict in message_list:
if is_python_script:
message_dict['row'] = message_dict['row'] - 2
else:
message_dict['row'] = message_dict['row'] - 1
if message_dict['type'] in ('E', 'F'):
message_dict['type'] = 'error'
else:
message_dict['type'] = 'warning'
if REQUEST is not None:
REQUEST.RESPONSE.setHeader('content-type', 'application/json')
return json.dumps(dict(annotations=message_list))
def filterSecurityUidDict(security_uid_dict, referenced_security_uid_set):
"""
......
......@@ -7,5 +7,4 @@ document.erp5.ApparelMeasurement
document.erp5.ApparelModel
document.erp5.ApparelShape
document.erp5.ApparelSize
document.erp5.Consumption
document.erp5.VariationImage
\ No newline at end of file
portal_components/document.erp5.Consumption
\ No newline at end of file
......@@ -66,7 +66,6 @@
<item>Causality Movement Group</item>
<item>Day Movement Group</item>
<item>Delivery Causality Assignment Movement Group</item>
<item>First Causality Movement Group</item>
<item>Invoice Movement Group</item>
<item>Monthly Range Movement Group</item>
<item>Nested Line Movement Group</item>
......@@ -129,7 +128,4 @@
<portal_type id="Rounding Tool">
<item>Rounding Model</item>
</portal_type>
<portal_type id="Solver Tool">
<item>Solver Type</item>
</portal_type>
</allowed_content_type_list>
\ No newline at end of file
......@@ -40,7 +40,6 @@ Order Builder | Causality Assignment Movement Group
Order Builder | Causality Movement Group
Order Builder | Day Movement Group
Order Builder | Delivery Causality Assignment Movement Group
Order Builder | First Causality Movement Group
Order Builder | Invoice Movement Group
Order Builder | Monthly Range Movement Group
Order Builder | Nested Line Movement Group
......@@ -88,4 +87,3 @@ Person | Link
Person | Telephone
Query Module | Query
Rounding Tool | Rounding Model
\ No newline at end of file
Solver Tool | Solver Type
\ No newline at end of file
......@@ -54,7 +54,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Component_getErrorWarningMessageDictAsJson</string> </value>
<value> <string>ComponentMixin_getErrorWarningMessageDictAsJson</string> </value>
</item>
</dictionary>
</pickle>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ComponentMixin_getTextContentHistoryRevisionDictListAsJSON</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -159,7 +159,7 @@
$.ajax({type: 'GET',
async: false,
url: 'Component_getErrorWarningMessageDictAsJson',
url: 'ComponentMixin_getErrorWarningMessageDictAsJson',
success: getErrorWarningMessageDictHandler});
}
......@@ -651,7 +651,7 @@
$.ajax({type: 'GET',
async: true,
dataType: 'json',
url: 'Component_getTextContentHistoryRevisionDictListAsJSON',
url: 'ComponentMixin_getTextContentHistoryRevisionDictListAsJSON',
success: successHandler});
}
......
erp5_crm
erp5_dms
erp5_trade
\ No newline at end of file
erp5_base
erp5_interfaces
\ No newline at end of file
......@@ -59,7 +59,7 @@ class Consumption(XMLObject, XMLMatrix, VariatedMixin):
security.declareProtected(Permissions.ModifyPortalContent,
'_setVariationCategoryList')
def _setVariationCategoryList(self,value):
def _setVariationCategoryList(self, value, base_category_list=()):
"""
Set consumption variation category list.
Set matrix cell range.
......@@ -74,7 +74,7 @@ class Consumption(XMLObject, XMLMatrix, VariatedMixin):
security.declareProtected(Permissions.ModifyPortalContent,
'setVariationCategoryList')
def setVariationCategoryList(self,value):
def setVariationCategoryList(self, value, base_category_list=()):
"""
Set consumption variation category list.
Reindex Object.
......@@ -84,13 +84,17 @@ class Consumption(XMLObject, XMLMatrix, VariatedMixin):
security.declareProtected(Permissions.ModifyPortalContent,
'getVariationRangeBaseCategoryItemList')
def getVariationRangeBaseCategoryItemList(self):
def getVariationRangeBaseCategoryItemList(
self,
base=1,
display_id='getTitle',
current_category=None):
"""
Return range of base variation item
Left display
"""
# XXX get TitleOrId
return map( lambda x: (x,x) , self.getVariationRangeBaseCategoryList() )
return [(x, x) for x in self.getVariationRangeBaseCategoryList()]
security.declareProtected(Permissions.ModifyPortalContent,
'getQuantityRatio')
......
......@@ -6,6 +6,12 @@
</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>Consumption</string> </value>
......@@ -14,6 +20,12 @@
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.Document.Consumption</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>document.erp5.Consumption</string> </value>
......@@ -37,47 +49,7 @@
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple>
<string>W: 40, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 45, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 46, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 49, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 50, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 53, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 60, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 62, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 63, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 67, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 73, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 75, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 77, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 78, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 82, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 83, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 85, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 87, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 88, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 93, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 95, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 97, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 99, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W:103, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W:105, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W:107, 0: Bad indentation. Found 8 spaces, expected 6 (bad-indentation)</string>
<string>W:108, 0: Bad indentation. Found 8 spaces, expected 6 (bad-indentation)</string>
<string>W:109, 0: Bad indentation. Found 10 spaces, expected 8 (bad-indentation)</string>
<string>W:110, 0: Bad indentation. Found 8 spaces, expected 6 (bad-indentation)</string>
<string>W:111, 0: Bad indentation. Found 10 spaces, expected 8 (bad-indentation)</string>
<string>W:112, 0: Bad indentation. Found 10 spaces, expected 8 (bad-indentation)</string>
<string>W:113, 0: Bad indentation. Found 12 spaces, expected 10 (bad-indentation)</string>
<string>W:114, 0: Bad indentation. Found 10 spaces, expected 8 (bad-indentation)</string>
<string>W:115, 0: Bad indentation. Found 12 spaces, expected 10 (bad-indentation)</string>
<string>W:117, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 62, 4: Arguments number differs from overridden \'_setVariationCategoryList\' method (arguments-differ)</string>
<string>W: 77, 4: Arguments number differs from overridden \'setVariationCategoryList\' method (arguments-differ)</string>
<string>W: 87, 4: Arguments number differs from overridden \'getVariationRangeBaseCategoryItemList\' method (arguments-differ)</string>
<string>W: 93, 13: map/filter on lambda could be replaced by comprehension (deprecated-lambda)</string>
</tuple>
<tuple/>
</value>
</item>
<item>
......@@ -87,13 +59,28 @@
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
<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>
......@@ -106,7 +93,7 @@
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
......@@ -115,7 +102,7 @@
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
......
......@@ -227,6 +227,8 @@
<string>matrixbox_for_max_order_quantity</string>
<string>my_view_mode_target_delivery</string>
<string>my_base_price_per_slice</string>
<string>my_report_mode_listbox_variation_category_item_list</string>
<string>my_view_mode_read_only_title</string>
</list>
</value>
</item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>default</string>
<string>editable</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_report_mode_listbox_variation_category_item_list</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_lines_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Variation Category Items</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: [x[0] for x in cell.getVariationCategoryItemList()]</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>editable</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_view_mode_read_only_title</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>editable</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_title</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -75,7 +75,7 @@
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewTradeFieldLibrary</string> </value>
<value> <string>Base_viewPDMFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
......
......@@ -75,7 +75,7 @@
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewTradeFieldLibrary</string> </value>
<value> <string>Base_viewPDMFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
......
......@@ -191,7 +191,7 @@
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewTradeFieldLibrary</string> </value>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>list_action</string> </key>
......
......@@ -75,7 +75,7 @@
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewTradeFieldLibrary</string> </value>
<value> <string>Base_viewPDMFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
......
......@@ -75,7 +75,7 @@
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewTradeFieldLibrary</string> </value>
<value> <string>Base_viewPDMFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
......
document.erp5.Consumption
\ No newline at end of file
......@@ -87,6 +87,9 @@
<portal_type id="Inventory Report Module">
<item>Inventory Report</item>
</portal_type>
<portal_type id="Order Builder">
<item>First Causality Movement Group</item>
</portal_type>
<portal_type id="Order Root Simulation Rule">
<item>Category Membership Divergence Tester</item>
<item>DateTime Divergence Tester</item>
......
......@@ -42,6 +42,7 @@ Inventory Module | Inventory
Inventory Report Module | Inventory Report
Inventory Report | Inventory Report Line
Inventory | Inventory Line
Order Builder | First Causality Movement Group
Order Root Simulation Rule | Category Membership Divergence Tester
Order Root Simulation Rule | DateTime Divergence Tester
Order Root Simulation Rule | Float Divergence Tester
......
import json
from Products.ERP5Type.Utils import checkPythonSourceCode
def checkPythonSourceCodeAsJSON(self, data, REQUEST=None):
"""
Check Python source suitable for Source Code Editor and return a JSON object
"""
# XXX data is encoded as json, because jQuery serialize lists as []
if isinstance(data, basestring):
data = json.loads(data)
# data contains the code, the bound names and the script params. From this
# we reconstruct a function that can be checked
def indent(text):
return ''.join((" " + line) for line in text.splitlines(True))
is_python_script = 'bound_names' in data
if is_python_script:
signature_parts = data['bound_names']
if data['params']:
signature_parts += [data['params']]
signature = ", ".join(signature_parts)
function_name = "function_name"
body = "def %s(%s):\n%s" % (function_name,
signature,
indent(data['code']) or " pass")
else:
body = data['code']
message_list = checkPythonSourceCode(body.encode('utf8'), data.get('portal_type'))
for message_dict in message_list:
if is_python_script:
message_dict['row'] = message_dict['row'] - 2
else:
message_dict['row'] = message_dict['row'] - 1
if message_dict['type'] in ('E', 'F'):
message_dict['type'] = 'error'
else:
message_dict['type'] = 'warning'
if REQUEST is not None:
REQUEST.RESPONSE.setHeader('content-type', 'application/json')
return json.dumps(dict(annotations=message_list))
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Extension 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>PythonCodeUtils</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>extension.erp5.PythonCodeUtils</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Extension 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">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.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>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Component_getTextContentHistoryRevisionDictListAsJSON</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -12,7 +12,7 @@
</item>
<item>
<key> <string>_module</string> </key>
<value> <string>ERP5Administration</string> </value>
<value> <string>PythonCodeUtils</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -4,3 +4,4 @@ extension.erp5.SearchUtility
extension.erp5.StandardSecurity
extension.erp5.ZODBHistory
extension.erp5.FolderWorkflowActionUtils
extension.erp5.PythonCodeUtils
\ No newline at end of file
......@@ -180,6 +180,7 @@ ignored_skin_id_set = {
'SaleInvoiceTransaction_selectTaskReportMovement',
'TaskListOverviewGadget_setPreferences',
'TaskListsGadgetListbox_getLineCss',
'InventoryModule_reindexMovementList',
}
# Generic method to check consistency of a skin item
......
......@@ -43,13 +43,11 @@ class CodingStyleTest(CodingStyleTestCase, testXHTML.TestXHTMLMixin):
"""
def getBusinessTemplateList(self):
# install erp5_administration to check with tools from erp5_administration
# and erp5_upgrader for CodingStyleTestCase.test_run_upgrader
# install erp5_upgrader for CodingStyleTestCase.test_run_upgrader
# XXX also install erp5_full_text_myisam_catalog to workaround missing test
# dependencies and the fact that test dependencies are not checked
# recursively.
return (
'erp5_administration',
'erp5_upgrader',
'erp5_full_text_myisam_catalog',
self.tested_business_template)
......
......@@ -92,11 +92,8 @@ class CodingStyleTestCase(ERP5TypeTestCase):
def test_PythonSourceCode(self):
"""test python script from the tested business templates.
reuses BusinessTemplate_getPythonSourceCodeMessageList from erp5_administration
reuses BusinessTemplate_getPythonSourceCodeMessageList
"""
if 'erp5_administration' not in self.getBusinessTemplateList():
self.skipTest('erp5_administration needs be installed to check python source code')
self.maxDiff = None
for business_template in self.portal.portal_templates.contentValues():
if business_template.getTitle() in self.getTestedBusinessTemplateList():
......
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