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
Leo Le Bouter
erp5
Commits
331625e2
Commit
331625e2
authored
Jan 08, 2013
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CMFActivity: fix test_mergeParent on Python 2.7
Messages passed to a grouping method are not sorted.
parent
cc1f0763
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
6 deletions
+3
-6
product/CMFActivity/tests/testCMFActivity.py
product/CMFActivity/tests/testCMFActivity.py
+3
-6
No files found.
product/CMFActivity/tests/testCMFActivity.py
View file @
331625e2
...
@@ -3574,13 +3574,11 @@ class TestCMFActivity(ERP5TypeTestCase, LogInterceptor):
...
@@ -3574,13 +3574,11 @@ class TestCMFActivity(ERP5TypeTestCase, LogInterceptor):
c
=
[
category_tool
.
newContent
()]
c
=
[
category_tool
.
newContent
()]
for
i
in
xrange
(
5
):
for
i
in
xrange
(
5
):
c
.
append
(
c
[
i
//
2
].
newContent
())
c
.
append
(
c
[
i
//
2
].
newContent
())
transaction
.
commit
()
self
.
tic
()
self
.
tic
()
def
activate
(
i
,
priority
=
1
,
**
kw
):
def
activate
(
i
,
priority
=
1
,
**
kw
):
kw
.
setdefault
(
'merge_parent'
,
c
[
0
].
getPath
())
kw
.
setdefault
(
'merge_parent'
,
c
[
0
].
getPath
())
c
[
i
].
activate
(
priority
=
priority
,
**
kw
).
doSomething
()
c
[
i
].
activate
(
priority
=
priority
,
**
kw
).
doSomething
()
def
check
(
*
expected
):
def
check
(
*
expected
):
transaction
.
commit
()
self
.
tic
()
self
.
tic
()
self
.
assertEquals
(
tuple
(
invoked
),
expected
)
self
.
assertEquals
(
tuple
(
invoked
),
expected
)
del
invoked
[:]
del
invoked
[:]
...
@@ -3609,10 +3607,10 @@ class TestCMFActivity(ERP5TypeTestCase, LogInterceptor):
...
@@ -3609,10 +3607,10 @@ class TestCMFActivity(ERP5TypeTestCase, LogInterceptor):
merge_parent
=
c
[(
i
-
1
)
//
2
or
i
].
getPath
(),
merge_parent
=
c
[(
i
-
1
)
//
2
or
i
].
getPath
(),
priority
=
priority
,
**
kw
).
doSomething
()
priority
=
priority
,
**
kw
).
doSomething
()
def
invokeGroup
(
self
,
message_list
):
def
invokeGroup
(
self
,
message_list
):
invoked
.
append
(
[
c
.
index
(
m
[
0
])
for
m
in
message_list
]
)
invoked
.
append
(
sorted
(
c
.
index
(
m
[
0
])
for
m
in
message_list
)
)
category_tool
.
__class__
.
invokeGroup
=
invokeGroup
category_tool
.
__class__
.
invokeGroup
=
invokeGroup
try
:
try
:
activate
(
5
,
0
);
activate
(
1
,
1
);
check
([
5
,
1
])
activate
(
5
,
0
);
activate
(
1
,
1
);
check
([
1
,
5
])
activate
(
4
,
0
);
activate
(
1
,
1
);
activate
(
2
,
0
);
check
([
1
,
2
])
activate
(
4
,
0
);
activate
(
1
,
1
);
activate
(
2
,
0
);
check
([
1
,
2
])
activate
(
1
,
0
);
activate
(
5
,
0
);
activate
(
3
,
1
);
check
([
1
,
5
])
activate
(
1
,
0
);
activate
(
5
,
0
);
activate
(
3
,
1
);
check
([
1
,
5
])
for
p
,
i
in
enumerate
((
5
,
3
,
2
,
1
,
4
)):
for
p
,
i
in
enumerate
((
5
,
3
,
2
,
1
,
4
)):
...
@@ -3621,11 +3619,10 @@ class TestCMFActivity(ERP5TypeTestCase, LogInterceptor):
...
@@ -3621,11 +3619,10 @@ class TestCMFActivity(ERP5TypeTestCase, LogInterceptor):
for
cost
in
0.3
,
0.1
:
for
cost
in
0.3
,
0.1
:
activate
(
2
,
0
,
group_method_cost
=
cost
)
activate
(
2
,
0
,
group_method_cost
=
cost
)
activate
(
3
,
1
);
activate
(
4
,
2
);
activate
(
1
,
3
)
activate
(
3
,
1
);
activate
(
4
,
2
);
activate
(
1
,
3
)
check
([
2
,
1
])
check
([
1
,
2
])
finally
:
finally
:
del
category_tool
.
__class__
.
invokeGroup
del
category_tool
.
__class__
.
invokeGroup
category_tool
.
_delObject
(
c
[
0
].
getId
())
category_tool
.
_delObject
(
c
[
0
].
getId
())
transaction
.
commit
()
self
.
tic
()
self
.
tic
()
def
test_suite
():
def
test_suite
():
...
...
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