Commit ddd3e26c by Jérome Perrin

Repair testFunctionalStandaloneUserTutorial

Test was never ending processing activities:

```
2019-03-11T03:09:20 WARNING CMFActivity invalid after_path_and_method_id value: ('/erp5/organisation_module/2', 'immediateRecusriveReindexObject', 'immediateReindexObject')
Traceback (most recent call last):
  File "product/CMFActivity/Activity/SQLBase.py", line 319, in getValidationSQL
    validate_list.append(' AND '.join(method(v, quote)))
  File "product/CMFActivity/Activity/SQLBase.py", line 345, in _validate_after_path_and_method_id
    path, method_id = value
ValueError: too many values to unpack
2019-03-11T03:09:20 WARNING CMFActivity invalid after_path_and_method_id value: ('/erp5/organisation_module/2', 'immediateRecusriveReindexObject', 'immediateReindexObject')
Traceback (most recent call last):
  File "product/CMFActivity/Activity/SQLBase.py", line 319, in getValidationSQL
    validate_list.append(' AND '.join(method(v, quote)))
  File "product/CMFActivity/Activity/SQLBase.py", line 345, in _validate_after_path_and_method_id
    path, method_id = value
ValueError: too many values to unpack
2019-03-11T03:09:20 WARNING CMFActivity invalid after_path_and_method_id value: ('/erp5/organisation_module/2', 'immediateRecusriveReindexObject', 'immediateReindexObject')
Traceback (most recent call last):
  File "product/CMFActivity/Activity/SQLBase.py", line 319, in getValidationSQL
    validate_list.append(' AND '.join(method(v, quote)))
  File "product/CMFActivity/Activity/SQLBase.py", line 345, in _validate_after_path_and_method_id
    path, method_id = value
ValueError: too many values to unpack
2019-03-11T03:09:20 ERROR CMFActivity message uid 7256619472683296857L has a circular dependency
 ```

Fix this failing test by using the proper `after_path_and_method_id` syntax and also some other small changes to make the test fail earlier in case of problems.

/reviewed-on !844
2 parents 1f254aa7 494f871f
from time import sleep
from Products.CMFActivity.Activity.Queue import VALIDATION_ERROR_DELAY
def waitForActivities(self, count=1000):
"""
......@@ -8,14 +8,16 @@ def waitForActivities(self, count=1000):
to finish activities.
"""
activity_tool = self.getPortalObject().portal_activities
for x in xrange(count):
while count > 0:
count -= 1
x = activity_tool.getMessageList()
if not x:
return 'Done.'
if all(x.processing_node == -2 for x in x):
break
activity_tool.process_timer(None, None)
sleep(1)
if count % 10 == 0:
activity_tool.timeShift(3 * VALIDATION_ERROR_DELAY)
raise RuntimeError('tic is looping forever.')
def UpdateImage(image):
......
......@@ -95,7 +95,7 @@ pref.setPreferredHtmlStyleUnsavedFormWarning(False)
my_organisation.activate(
after_path_and_method_id=(
my_organisation.getPath(), 'immediateRecusriveReindexObject', 'immediateReindexObject')) \
my_organisation.getPath(), ('immediateRecusriveReindexObject', 'immediateReindexObject'))) \
.Organisation_addConditionallyAccountingPeriod()
for rule_reference in ('default_delivering_rule',
......
......@@ -59,7 +59,7 @@
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>assertTextPresent</td>
<td tal:content="python:
here.Zuite_getHowToInfo()['manager_username']"></td>
<td></td>
......@@ -74,7 +74,7 @@
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>assertTextPresent</td>
<td>Done.</td>
<td></td>
</tr>
......@@ -88,7 +88,7 @@
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>assertTextPresent</td>
<td>Done.</td>
<td></td>
</tr>
......@@ -102,7 +102,7 @@
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>assertTextPresent</td>
<td>Done.</td>
<td></td>
</tr>
......@@ -151,7 +151,7 @@
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>assertTextPresent</td>
<td tal:content="python:
here.Zuite_getHowToInfo()['functional_test_username']"></td>
<td></td>
......@@ -173,7 +173,7 @@
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>assertTextPresent</td>
<td>Init Ok.</td>
<td></td>
</tr>
......@@ -191,7 +191,7 @@
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>assertTextPresent</td>
<td>Done.</td>
<td></td>
</tr>
......@@ -240,7 +240,7 @@
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>assertTextPresent</td>
<td tal:content="python:
here.Zuite_getHowToInfo()['functional_another_test_username']"></td>
<td></td>
......@@ -262,7 +262,7 @@
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>assertTextPresent</td>
<td>Init Ok.</td>
<td></td>
</tr>
......@@ -313,7 +313,7 @@
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>assertTextPresent</td>
<td tal:content="python:
here.Zuite_getHowToInfo()['person_howto_reference']"></td>
<td></td>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!