Commit 7145fb63 authored by Guillaume Michon's avatar Guillaume Michon

Now test the following behavior when edit() does not change values :

- If edit_workflow is associated, reindexation only in activities
- Else, no reindexation at all
For Setters : reindexation in all cases, in activities


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3817 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f684407c
...@@ -127,6 +127,14 @@ class TestBase(ERP5TypeTestCase): ...@@ -127,6 +127,14 @@ class TestBase(ERP5TypeTestCase):
['Organisation'], ('validation_workflow', 'edit_workflow')) ['Organisation'], ('validation_workflow', 'edit_workflow'))
_aq_reset() _aq_reset()
def stepAssociateWorkflowsExcludingEdit(self, sequence=None, sequence_list=None, **kw):
"""
Associate workflow to the portal type
"""
self.getWorkflowTool().setChainForPortalTypes(
['Organisation'], ('validation_workflow',))
_aq_reset()
def stepCreateObject(self, sequence=None, sequence_list=None, **kw): def stepCreateObject(self, sequence=None, sequence_list=None, **kw):
""" """
Create a object which will be tested. Create a object which will be tested.
...@@ -195,6 +203,16 @@ class TestBase(ERP5TypeTestCase): ...@@ -195,6 +203,16 @@ class TestBase(ERP5TypeTestCase):
message_list = portal.portal_activities.getMessageList() message_list = portal.portal_activities.getMessageList()
self.assertEquals(len(message_list), 0) self.assertEquals(len(message_list), 0)
def stepMakeImmediateReindexObjectCrashing(self, sequence=None, sequence_list=None, **kw):
"""
Overwrite immediateReindexObject() with a crashing method
"""
def crashingMethod(self):
self.ImmediateReindexObjectIsCalled()
from Products.ERP5Type.Document.Organisation import Organisation
Organisation.immediateReindexObject = crashingMethod
Organisation.recursiveImmediateReindexObject = crashingMethod
def test_01_areActivitiesWellLaunchedByPropertyEdit(self, quiet=0, def test_01_areActivitiesWellLaunchedByPropertyEdit(self, quiet=0,
run=run_all_test): run=run_all_test):
""" """
...@@ -209,12 +227,14 @@ class TestBase(ERP5TypeTestCase): ...@@ -209,12 +227,14 @@ class TestBase(ERP5TypeTestCase):
CreateObject \ CreateObject \
Tic \ Tic \
CheckTitleValue \ CheckTitleValue \
MakeImmediateReindexObjectCrashing \
SetDifferentTitleValueWithEdit \ SetDifferentTitleValueWithEdit \
CheckIfActivitiesAreCreated \ CheckIfActivitiesAreCreated \
CheckTitleValue \ CheckTitleValue \
Tic \ Tic \
CheckIfMessageQueueIsEmpty \ CheckIfMessageQueueIsEmpty \
SetSameTitleValueWithEdit \ SetSameTitleValueWithEdit \
CheckTitleValue \
CheckIfMessageQueueIsEmpty \ CheckIfMessageQueueIsEmpty \
SetDifferentTitleValueWithEdit \ SetDifferentTitleValueWithEdit \
CheckIfActivitiesAreCreated \ CheckIfActivitiesAreCreated \
...@@ -229,12 +249,16 @@ class TestBase(ERP5TypeTestCase): ...@@ -229,12 +249,16 @@ class TestBase(ERP5TypeTestCase):
CreateObject \ CreateObject \
Tic \ Tic \
CheckTitleValue \ CheckTitleValue \
MakeImmediateReindexObjectCrashing \
SetDifferentTitleValueWithEdit \ SetDifferentTitleValueWithEdit \
CheckIfActivitiesAreCreated \ CheckIfActivitiesAreCreated \
CheckTitleValue \ CheckTitleValue \
Tic \ Tic \
CheckIfMessageQueueIsEmpty \ CheckIfMessageQueueIsEmpty \
SetSameTitleValueWithEdit \ SetSameTitleValueWithEdit \
CheckIfActivitiesAreCreated \
CheckTitleValue \
Tic \
CheckIfMessageQueueIsEmpty \ CheckIfMessageQueueIsEmpty \
SetDifferentTitleValueWithEdit \ SetDifferentTitleValueWithEdit \
CheckIfActivitiesAreCreated \ CheckIfActivitiesAreCreated \
...@@ -243,6 +267,28 @@ class TestBase(ERP5TypeTestCase): ...@@ -243,6 +267,28 @@ class TestBase(ERP5TypeTestCase):
CheckIfMessageQueueIsEmpty \ CheckIfMessageQueueIsEmpty \
' '
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
# Test with workflows associated to the portal type, excluding edit_workflow
sequence_string = '\
AssociateWorkflowsExcludingEdit \
CreateObject \
Tic \
CheckTitleValue \
MakeImmediateReindexObjectCrashing \
SetDifferentTitleValueWithEdit \
CheckIfActivitiesAreCreated \
CheckTitleValue \
Tic \
CheckIfMessageQueueIsEmpty \
SetSameTitleValueWithEdit \
CheckIfMessageQueueIsEmpty \
CheckTitleValue \
SetDifferentTitleValueWithEdit \
CheckIfActivitiesAreCreated \
CheckTitleValue \
Tic \
CheckIfMessageQueueIsEmpty \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self) sequence_list.play(self)
def stepCheckGroupValue(self, sequence=None, sequence_list=None, **kw): def stepCheckGroupValue(self, sequence=None, sequence_list=None, **kw):
...@@ -296,6 +342,7 @@ class TestBase(ERP5TypeTestCase): ...@@ -296,6 +342,7 @@ class TestBase(ERP5TypeTestCase):
CreateObject \ CreateObject \
Tic \ Tic \
CheckGroupValue \ CheckGroupValue \
MakeImmediateReindexObjectCrashing \
SetDifferentGroupValueWithEdit \ SetDifferentGroupValueWithEdit \
CheckIfActivitiesAreCreated \ CheckIfActivitiesAreCreated \
CheckGroupValue \ CheckGroupValue \
...@@ -316,6 +363,31 @@ class TestBase(ERP5TypeTestCase): ...@@ -316,6 +363,31 @@ class TestBase(ERP5TypeTestCase):
CreateObject \ CreateObject \
Tic \ Tic \
CheckGroupValue \ CheckGroupValue \
MakeImmediateReindexObjectCrashing \
SetDifferentGroupValueWithEdit \
CheckIfActivitiesAreCreated \
CheckGroupValue \
Tic \
CheckIfMessageQueueIsEmpty \
SetSameGroupValueWithEdit \
CheckIfActivitiesAreCreated \
CheckGroupValue \
Tic \
CheckIfMessageQueueIsEmpty \
SetDifferentGroupValueWithEdit \
CheckIfActivitiesAreCreated \
CheckGroupValue \
Tic \
CheckIfMessageQueueIsEmpty \
'
sequence_list.addSequenceString(sequence_string)
# Test with workflows associated to the portal type, excluding edit_workflow
sequence_string = '\
AssociateWorkflowsExcludingEdit \
CreateObject \
Tic \
CheckGroupValue \
MakeImmediateReindexObjectCrashing \
SetDifferentGroupValueWithEdit \ SetDifferentGroupValueWithEdit \
CheckIfActivitiesAreCreated \ CheckIfActivitiesAreCreated \
CheckGroupValue \ CheckGroupValue \
...@@ -367,12 +439,16 @@ class TestBase(ERP5TypeTestCase): ...@@ -367,12 +439,16 @@ class TestBase(ERP5TypeTestCase):
CreateObject \ CreateObject \
Tic \ Tic \
CheckTitleValue \ CheckTitleValue \
MakeImmediateReindexObjectCrashing \
SetDifferentTitleValueWithSetter \ SetDifferentTitleValueWithSetter \
CheckIfActivitiesAreCreated \ CheckIfActivitiesAreCreated \
CheckTitleValue \ CheckTitleValue \
Tic \ Tic \
CheckIfMessageQueueIsEmpty \ CheckIfMessageQueueIsEmpty \
SetSameTitleValueWithSetter \ SetSameTitleValueWithSetter \
CheckIfActivitiesAreCreated \
CheckTitleValue \
Tic \
CheckIfMessageQueueIsEmpty \ CheckIfMessageQueueIsEmpty \
SetDifferentTitleValueWithSetter \ SetDifferentTitleValueWithSetter \
CheckIfActivitiesAreCreated \ CheckIfActivitiesAreCreated \
...@@ -387,12 +463,16 @@ class TestBase(ERP5TypeTestCase): ...@@ -387,12 +463,16 @@ class TestBase(ERP5TypeTestCase):
CreateObject \ CreateObject \
Tic \ Tic \
CheckTitleValue \ CheckTitleValue \
MakeImmediateReindexObjectCrashing \
SetDifferentTitleValueWithSetter \ SetDifferentTitleValueWithSetter \
CheckIfActivitiesAreCreated \ CheckIfActivitiesAreCreated \
CheckTitleValue \ CheckTitleValue \
Tic \ Tic \
CheckIfMessageQueueIsEmpty \ CheckIfMessageQueueIsEmpty \
SetSameTitleValueWithSetter \ SetSameTitleValueWithSetter \
CheckIfActivitiesAreCreated \
CheckTitleValue \
Tic \
CheckIfMessageQueueIsEmpty \ CheckIfMessageQueueIsEmpty \
SetDifferentTitleValueWithSetter \ SetDifferentTitleValueWithSetter \
CheckIfActivitiesAreCreated \ CheckIfActivitiesAreCreated \
...@@ -445,12 +525,16 @@ class TestBase(ERP5TypeTestCase): ...@@ -445,12 +525,16 @@ class TestBase(ERP5TypeTestCase):
CreateObject \ CreateObject \
Tic \ Tic \
CheckGroupValue \ CheckGroupValue \
MakeImmediateReindexObjectCrashing \
SetDifferentGroupValueWithSetter \ SetDifferentGroupValueWithSetter \
CheckIfActivitiesAreCreated \ CheckIfActivitiesAreCreated \
CheckGroupValue \ CheckGroupValue \
Tic \ Tic \
CheckIfMessageQueueIsEmpty \ CheckIfMessageQueueIsEmpty \
SetSameGroupValueWithSetter \ SetSameGroupValueWithSetter \
CheckIfActivitiesAreCreated \
CheckGroupValue \
Tic \
CheckIfMessageQueueIsEmpty \ CheckIfMessageQueueIsEmpty \
SetDifferentGroupValueWithSetter \ SetDifferentGroupValueWithSetter \
CheckIfActivitiesAreCreated \ CheckIfActivitiesAreCreated \
...@@ -465,12 +549,16 @@ class TestBase(ERP5TypeTestCase): ...@@ -465,12 +549,16 @@ class TestBase(ERP5TypeTestCase):
CreateObject \ CreateObject \
Tic \ Tic \
CheckGroupValue \ CheckGroupValue \
MakeImmediateReindexObjectCrashing \
SetDifferentGroupValueWithSetter \ SetDifferentGroupValueWithSetter \
CheckIfActivitiesAreCreated \ CheckIfActivitiesAreCreated \
CheckGroupValue \ CheckGroupValue \
Tic \ Tic \
CheckIfMessageQueueIsEmpty \ CheckIfMessageQueueIsEmpty \
SetSameGroupValueWithSetter \ SetSameGroupValueWithSetter \
CheckIfActivitiesAreCreated \
CheckGroupValue \
Tic \
CheckIfMessageQueueIsEmpty \ CheckIfMessageQueueIsEmpty \
SetDifferentGroupValueWithSetter \ SetDifferentGroupValueWithSetter \
CheckIfActivitiesAreCreated \ CheckIfActivitiesAreCreated \
......
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