Commit a87da503 authored by Jérome Perrin's avatar Jérome Perrin

erp5_core_test: style fixes

parent b9beb439
...@@ -212,7 +212,7 @@ class BusinessTemplateMixin(ERP5TypeTestCase, LogInterceptor): ...@@ -212,7 +212,7 @@ class BusinessTemplateMixin(ERP5TypeTestCase, LogInterceptor):
Get a business template at portal_templates Get a business template at portal_templates
""" """
template_tool = self.getTemplateTool() template_tool = self.getTemplateTool()
for bt in template_tool.objectValues(filter={'portal_type':'Business Template'}): for bt in template_tool.objectValues(filter={'portal_type': 'Business Template'}):
if bt.getTitle() == title: if bt.getTitle() == title:
return bt return bt
return None return None
...@@ -2640,7 +2640,7 @@ class BusinessTemplateMixin(ERP5TypeTestCase, LogInterceptor): ...@@ -2640,7 +2640,7 @@ class BusinessTemplateMixin(ERP5TypeTestCase, LogInterceptor):
import_bt = sequence.get('import_bt') import_bt = sequence.get('import_bt')
pc = self.getCatalogTool() pc = self.getCatalogTool()
catalog_id = pc.getSQLCatalog().id catalog_id = pc.getSQLCatalog().id
object_to_update = {'portal_catalog/'+catalog_id+'/z_another_fake_method':'install'} object_to_update = {'portal_catalog/'+catalog_id+'/z_another_fake_method': 'install'}
import_bt.install(object_to_update=object_to_update) import_bt.install(object_to_update=object_to_update)
def stepCreateNewBusinessTemplate(self, sequence=None, **kw): def stepCreateNewBusinessTemplate(self, sequence=None, **kw):
...@@ -2822,7 +2822,7 @@ class BusinessTemplateMixin(ERP5TypeTestCase, LogInterceptor): ...@@ -2822,7 +2822,7 @@ class BusinessTemplateMixin(ERP5TypeTestCase, LogInterceptor):
'template_portal_type_hidden_content_type_list', 'template_portal_type_hidden_content_type_list',
'template_portal_type_property_sheet_list', 'template_portal_type_property_sheet_list',
'template_portal_type_base_category_list'): 'template_portal_type_base_category_list'):
continue continue
if prop_type == 'text' or prop_type == 'string': if prop_type == 'text' or prop_type == 'string':
prop_dict[pid] = '' prop_dict[pid] = ''
elif prop_type == 'int': elif prop_type == 'int':
...@@ -3141,7 +3141,7 @@ class BusinessTemplateMixin(ERP5TypeTestCase, LogInterceptor): ...@@ -3141,7 +3141,7 @@ class BusinessTemplateMixin(ERP5TypeTestCase, LogInterceptor):
python_script_id = 'ERP5Site_dummyScriptWhichRandomId%s' % grain_of_sand python_script_id = 'ERP5Site_dummyScriptWhichRandomId%s' % grain_of_sand
skin_folder_id = 'custom' skin_folder_id = 'custom'
if getattr(self.portal.portal_skins, skin_folder_id, None) is None: if getattr(self.portal.portal_skins, skin_folder_id, None) is None:
self.portal.portal_skins.manage_addProduct['OFSP'].manage_addFolder(skin_folder_id) self.portal.portal_skins.manage_addProduct['OFSP'].manage_addFolder(skin_folder_id)
skin_folder = self.portal.portal_skins[skin_folder_id] skin_folder = self.portal.portal_skins[skin_folder_id]
skin_folder.manage_addProduct['PythonScripts'].manage_addPythonScript( skin_folder.manage_addProduct['PythonScripts'].manage_addPythonScript(
id=python_script_id) id=python_script_id)
...@@ -6570,7 +6570,7 @@ class TestBusinessTemplate(BusinessTemplateMixin): ...@@ -6570,7 +6570,7 @@ class TestBusinessTemplate(BusinessTemplateMixin):
finally: finally:
shutil.rmtree(export_dir) shutil.rmtree(export_dir)
new_bt.install(force=0, object_to_update={'dummy_type_provider':'remove'}) new_bt.install(force=0, object_to_update={'dummy_type_provider': 'remove'})
self.assertNotEquals(None, types_tool.getTypeInfo('Base Category')) self.assertNotEquals(None, types_tool.getTypeInfo('Base Category'))
self.assertNotIn('dummy_type_provider', types_tool.type_provider_list) self.assertNotIn('dummy_type_provider', types_tool.type_provider_list)
......
...@@ -1559,7 +1559,7 @@ class ObjectTemplateItem(BaseTemplateItem): ...@@ -1559,7 +1559,7 @@ class ObjectTemplateItem(BaseTemplateItem):
if update_dict.has_key(widget_path) and update_dict[widget_path] in ('remove', 'save_and_remove'): if update_dict.has_key(widget_path) and update_dict[widget_path] in ('remove', 'save_and_remove'):
continue continue
widget_in_form = 0 widget_in_form = 0
for group_id, group_value_list in new_groups_dict.iteritems(): for group_value_list in new_groups_dict.values():
if widget_id in group_value_list: if widget_id in group_value_list:
widget_in_form = 1 widget_in_form = 1
break break
...@@ -1715,7 +1715,7 @@ class PathTemplateItem(ObjectTemplateItem): ...@@ -1715,7 +1715,7 @@ class PathTemplateItem(ObjectTemplateItem):
if len(id_list) == 0: if len(id_list) == 0:
return ['/'.join(relative_url_list)] return ['/'.join(relative_url_list)]
id = id_list[0] id = id_list[0]
if re.search('[\*\?\[\]]', id) is None: if re.search(r'[\*\?\[\]]', id) is None:
# If the id has no meta character, do not have to check all objects. # If the id has no meta character, do not have to check all objects.
obj = folder._getOb(id, None) obj = folder._getOb(id, None)
if obj is None: if obj is None:
...@@ -1772,7 +1772,7 @@ class PathTemplateItem(ObjectTemplateItem): ...@@ -1772,7 +1772,7 @@ class PathTemplateItem(ObjectTemplateItem):
# Ignore any object without PortalType (non-ERP5 objects) # Ignore any object without PortalType (non-ERP5 objects)
try: try:
portal_type = aq_base(obj).getPortalType() portal_type = aq_base(obj).getPortalType()
except Exception, e: except Exception:
pass pass
else: else:
if portal_type not in p.portal_types: if portal_type not in p.portal_types:
......
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