Commit 0d03838b authored by wenjie.zheng's avatar wenjie.zheng

Improved Politesses 2

parent a7933c2f
...@@ -85,6 +85,7 @@ from urllib import quote, unquote ...@@ -85,6 +85,7 @@ from urllib import quote, unquote
from difflib import unified_diff from difflib import unified_diff
import posixpath import posixpath
import transaction import transaction
import threading import threading
from ZODB.broken import Broken from ZODB.broken import Broken
from Products.ERP5.genbt5list import BusinessTemplateRevision, \ from Products.ERP5.genbt5list import BusinessTemplateRevision, \
...@@ -116,9 +117,6 @@ catalog_method_filter_list = ('_filter_expression_archive', ...@@ -116,9 +117,6 @@ catalog_method_filter_list = ('_filter_expression_archive',
INSTALLED_BT_FOR_DIFF = 'installed_bt_for_diff' INSTALLED_BT_FOR_DIFF = 'installed_bt_for_diff'
_MARKER = [] _MARKER = []
def _getCatalog(acquisition_context): def _getCatalog(acquisition_context):
""" """
Return the id of the SQLCatalog which correspond to the current BT. Return the id of the SQLCatalog which correspond to the current BT.
...@@ -5867,8 +5865,9 @@ Business Template is a set of definitions, such as skins, portal types and categ ...@@ -5867,8 +5865,9 @@ Business Template is a set of definitions, such as skins, portal types and categ
for act_id in action_list: for act_id in action_list:
if act_id is None: if act_id is None:
return (1, Base_translateString("ERROR: An action has an empty id on portal_type ${id}" return (1, Base_translateString(
,mapping=dict(id=id))) "ERROR: An action has an empty id on portal_type ${id}",
mapping=dict(id=id)))
action_id = id+' | '+act_id action_id = id+' | '+act_id
if action_id not in bt_action_list: if action_id not in bt_action_list:
bt_action_list.append(action_id) bt_action_list.append(action_id)
......
...@@ -1494,14 +1494,14 @@ class BusinessTemplateMixin(ERP5TypeTestCase, LogInterceptor): ...@@ -1494,14 +1494,14 @@ class BusinessTemplateMixin(ERP5TypeTestCase, LogInterceptor):
float_index=2.0) float_index=2.0)
sequence.edit(first_action_id='become_geek') sequence.edit(first_action_id='become_geek')
def stepTestFirstAction(self, sequence=None,**kw): def stepTestFirstAction(self, sequence=None, **kw):
pt = self.getTypeTool() pt = self.getTypeTool()
object_id = sequence.get('object_ptype_id') object_id = sequence.get('object_ptype_id')
object_pt = pt._getOb(object_id) object_pt = pt._getOb(object_id)
bt = sequence.get('current_bt', None) bt = sequence.get('current_bt', None)
self.assertTrue(bt is not None) self.assertTrue(bt is not None)
result, message = bt.getPortalTypesProperties() result, message = bt.getPortalTypesProperties()
self.assertEqual(result,0) self.assertEqual(result, 0)
def stepCreateEmptyAction(self, sequence=None, **kw): def stepCreateEmptyAction(self, sequence=None, **kw):
""" """
...@@ -1515,14 +1515,14 @@ class BusinessTemplateMixin(ERP5TypeTestCase, LogInterceptor): ...@@ -1515,14 +1515,14 @@ class BusinessTemplateMixin(ERP5TypeTestCase, LogInterceptor):
action_permission_list=(), action_permission_list=(),
float_index=1.2) float_index=1.2)
def stepTestEmptyAction(self, sequence=None,**kw): def stepTestEmptyAction(self, sequence=None, **kw):
pt = self.getTypeTool() pt = self.getTypeTool()
object_id = sequence.get('object_ptype_id') object_id = sequence.get('object_ptype_id')
object_pt = pt._getOb(object_id) object_pt = pt._getOb(object_id)
bt = sequence.get('current_bt', None) bt = sequence.get('current_bt', None)
self.assertTrue(bt is not None) self.assertTrue(bt is not None)
result, message = bt.getPortalTypesProperties() result, message = bt.getPortalTypesProperties()
self.assertEqual(result,1) self.assertEqual(result, 1)
def stepCreateSecondAction(self, sequence=None, **kw): def stepCreateSecondAction(self, sequence=None, **kw):
""" """
......
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