Commit 94eedd77 authored by Jérome Perrin's avatar Jérome Perrin

erp5_core_test: style fixes

parent 3b45cd05
...@@ -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):
...@@ -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