Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alexander Emmerich
erp5
Commits
b2aac901
Commit
b2aac901
authored
Jan 12, 2021
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CMFActivity.tests: Fix serialization_tag + group method test.
parent
4ea056c7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
6 deletions
+58
-6
product/CMFActivity/tests/testCMFActivity.py
product/CMFActivity/tests/testCMFActivity.py
+58
-6
No files found.
product/CMFActivity/tests/testCMFActivity.py
View file @
b2aac901
...
@@ -1320,18 +1320,70 @@ class TestCMFActivity(ERP5TypeTestCase, LogInterceptor):
...
@@ -1320,18 +1320,70 @@ class TestCMFActivity(ERP5TypeTestCase, LogInterceptor):
foo.activate(serialization_tag='a', group_method_id='x').getTitle()
foo.activate(serialization_tag='a', group_method_id='x').getTitle()
foo.activate(serialization_tag='a').getId()
foo.activate(serialization_tag='a').getId()
"""
"""
def
getMessageList
():
return
[
(
x
.
activity_kw
[
'serialization_tag'
],
x
.
processing_node
)
for
x
in
activity_tool
.
getMessageList
()
]
def
activate
(
serialization_tag
=
'a'
):
organisation
.
activate
(
serialization_tag
=
serialization_tag
,
group_method_id
=
'portal_catalog/catalogObjectList'
,
).
getTitle
()
organisation
=
self
.
portal
.
organisation_module
.
newContent
(
portal_type
=
'Organisation'
)
organisation
=
self
.
portal
.
organisation_module
.
newContent
(
portal_type
=
'Organisation'
)
self
.
tic
()
self
.
tic
()
activity_tool
=
self
.
getActivityTool
()
activity_tool
=
self
.
getActivityTool
()
organisation
.
activate
(
serialization_tag
=
'a'
).
getId
(
)
activate
(
'a'
)
self
.
commit
()
self
.
commit
()
organisation
.
activate
(
serialization_tag
=
'a'
,
activate
(
'a'
)
group_method_id
=
'portal_catalog/catalogObjectList'
).
getTitle
()
self
.
commit
()
self
.
commit
()
self
.
assertEqual
(
len
(
activity_tool
.
getMessageList
()),
2
)
# Both activities are queued
self
.
assertItemsEqual
(
getMessageList
(),
[
(
'a'
,
-
1
),
(
'a'
,
-
1
),
],
)
activity_tool
.
distribute
()
activity_tool
.
distribute
()
# After distribute, there is no deletion because it is different method
# Both activities are validated at the same time.
self
.
assertEqual
(
len
(
activity_tool
.
getMessageList
()),
2
)
# Note: this specific test implmeentation relies on the absence of
# validation-time deduplication which is not strictly related to
# serialization_tag behaviour.
self
.
assertItemsEqual
(
getMessageList
(),
[
(
'a'
,
0
),
(
'a'
,
0
),
],
)
activate
(
'a'
)
self
.
commit
()
activate
(
'b'
)
self
.
commit
()
# 3rd & 4th activities queued
self
.
assertItemsEqual
(
getMessageList
(),
[
(
'a'
,
0
),
(
'a'
,
0
),
(
'a'
,
-
1
),
(
'b'
,
-
1
),
],
)
activity_tool
.
distribute
()
# 3rd activity does not get validated, 4th is validated
self
.
assertItemsEqual
(
getMessageList
(),
[
(
'a'
,
0
),
(
'a'
,
0
),
(
'a'
,
-
1
),
(
'b'
,
0
),
],
)
# 1st, 2nd and 4th are executed, then 3rd gets validated an executed,
# and the queue ends empty.
self
.
tic
()
self
.
tic
()
def
test_104_interQueuePriorities
(
self
):
def
test_104_interQueuePriorities
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment