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
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
478066f3
Commit
478066f3
authored
Apr 23, 2024
by
Carlos Ramos Carreño
Browse files
Options
Browse Files
Download
Plain Diff
Fix CMFCategory test in Python 2.
See merge request
nexedi/erp5!1927
parents
194af65f
905085b7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
product/CMFCategory/tests/testCMFCategory.py
product/CMFCategory/tests/testCMFCategory.py
+8
-6
No files found.
product/CMFCategory/tests/testCMFCategory.py
View file @
478066f3
...
@@ -1000,23 +1000,25 @@ class TestCMFCategory(ERP5TypeTestCase):
...
@@ -1000,23 +1000,25 @@ class TestCMFCategory(ERP5TypeTestCase):
# emitted. Because the method exists on both category and base category
# emitted. Because the method exists on both category and base category
# there can be two warnings.
# there can be two warnings.
with
warnings
.
catch_warnings
(
record
=
True
)
as
warning_list
:
with
warnings
.
catch_warnings
(
record
=
True
)
as
warning_list
:
warnings
.
simplefilter
(
"always"
)
c1
.
getCategoryChildValueList
(
local_sort_method
=
sort_func
)
c1
.
getCategoryChildValueList
(
local_sort_method
=
sort_func
)
self
.
assertEqual
(
self
.
assertEqual
(
[
str
(
w
.
message
)
for
w
in
warning_list
]
,
{
str
(
w
.
message
)
for
w
in
warning_list
}
,
[
'`local_sort_method` argument is deprecated, use `local_sort_key` instead'
]
)
{
'`local_sort_method` argument is deprecated, use `local_sort_key` instead'
}
)
with
warnings
.
catch_warnings
(
record
=
True
)
as
warning_list
:
with
warnings
.
catch_warnings
(
record
=
True
)
as
warning_list
:
warnings
.
simplefilter
(
"always"
)
bc
.
getCategoryChildValueList
(
local_sort_method
=
sort_func
)
bc
.
getCategoryChildValueList
(
local_sort_method
=
sort_func
)
self
.
assertEqual
(
self
.
assertEqual
(
[
str
(
w
.
message
)
for
w
in
warning_list
]
,
{
str
(
w
.
message
)
for
w
in
warning_list
}
,
[
'`local_sort_method` argument is deprecated, use `local_sort_key` instead'
]
*
2
)
{
'`local_sort_method` argument is deprecated, use `local_sort_key` instead'
}
)
sort_func_calls
.
clear
()
del
sort_func_calls
[:]
# here c1, c2, c3 are sorted by their titles
# here c1, c2, c3 are sorted by their titles
self
.
assertEqual
(
list
(
bc
.
getCategoryChildValueList
(
self
.
assertEqual
(
list
(
bc
.
getCategoryChildValueList
(
local_sort_method
=
sort_func
)),
local_sort_method
=
sort_func
)),
[
c3
,
c2
,
c1
,
c11
,
c111
,
c12
])
[
c3
,
c2
,
c1
,
c11
,
c111
,
c12
])
self
.
assertTrue
(
sort_func_calls
)
self
.
assertTrue
(
sort_func_calls
)
sort_func_calls
.
clear
()
del
sort_func_calls
[:]
# here c11 & c12 are sorted by their titles
# here c11 & c12 are sorted by their titles
self
.
assertEqual
(
list
(
c1
.
getCategoryChildValueList
(
self
.
assertEqual
(
list
(
c1
.
getCategoryChildValueList
(
local_sort_method
=
sort_func
)),
[
c11
,
c111
,
c12
])
local_sort_method
=
sort_func
)),
[
c11
,
c111
,
c12
])
...
...
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