Commit de67aec3 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_cloud: [Test] patch _reindexObject

 The Base.reindexObject is not called directly anymore, so patch a deeper level
parent 50737417
...@@ -2780,13 +2780,13 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin): ...@@ -2780,13 +2780,13 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
return self.reindexObject_call(*args, **kw) return self.reindexObject_call(*args, **kw)
from Products.ERP5Type.Base import Base from Products.ERP5Type.Base import Base
Base.reindexObject_call = Base.reindexObject Base.reindexObject_call = Base._reindexObject
Base.reindexObject = verify_reindexObject_call Base._reindexObject = verify_reindexObject_call
try: try:
getattr(installation, method_id)() getattr(installation, method_id)()
self.tic() self.tic()
finally: finally:
Base.reindexObject = Base.reindexObject_call Base._reindexObject = Base.reindexObject_call
self.assertEqual( self.assertEqual(
'reindexObject triggered on %s' % method_id, 'reindexObject triggered on %s' % method_id,
computer.workflow_history['edit_workflow'][-1]['comment']) computer.workflow_history['edit_workflow'][-1]['comment'])
...@@ -2842,13 +2842,13 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin): ...@@ -2842,13 +2842,13 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
# Replace activeSense by a dummy method # Replace activeSense by a dummy method
from Products.ERP5Type.Base import Base from Products.ERP5Type.Base import Base
Base.reindexObject_call = Base.reindexObject Base.reindexObject_call = Base._reindexObject
Base.reindexObject = verify_reindexObject_call Base._reindexObject = verify_reindexObject_call
try: try:
getattr(instance, method_id)(**request_kw) getattr(instance, method_id)(**request_kw)
self.tic() self.tic()
finally: finally:
Base.reindexObject = Base.reindexObject_call Base._reindexObject = Base.reindexObject_call
self.assertEqual( self.assertEqual(
'reindexObject triggered on %s' % method_id, 'reindexObject triggered on %s' % method_id,
partition.workflow_history['edit_workflow'][-1]['comment']) partition.workflow_history['edit_workflow'][-1]['comment'])
...@@ -2966,13 +2966,13 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin): ...@@ -2966,13 +2966,13 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
# Replace activeSense by a dummy method # Replace activeSense by a dummy method
from Products.ERP5Type.Base import Base from Products.ERP5Type.Base import Base
Base.reindexObject_call = Base.reindexObject Base.reindexObject_call = Base._reindexObject
Base.reindexObject = verify_reindexObject_call Base._reindexObject = verify_reindexObject_call
try: try:
instance1.edit(predecessor_value=instance3) instance1.edit(predecessor_value=instance3)
self.tic() self.tic()
finally: finally:
Base.reindexObject = Base.reindexObject_call Base._reindexObject = Base.reindexObject_call
self.assertEqual( self.assertEqual(
'reindexObject triggered', 'reindexObject triggered',
instance1.workflow_history['edit_workflow'][-1]['comment']) instance1.workflow_history['edit_workflow'][-1]['comment'])
......
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