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
4d6f4edd
Commit
4d6f4edd
authored
Feb 11, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
listbox: py3
parent
d71ed0a6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
bt5/erp5_ui_test/TestTemplateItem/portal_components/test.erp5.testListBox.py
...stTemplateItem/portal_components/test.erp5.testListBox.py
+9
-3
product/ERP5Form/ListBox.py
product/ERP5Form/ListBox.py
+1
-1
No files found.
bt5/erp5_ui_test/TestTemplateItem/portal_components/test.erp5.testListBox.py
View file @
4d6f4edd
...
@@ -40,6 +40,7 @@ from Products.ERP5Type.Globals import get_request
...
@@ -40,6 +40,7 @@ from Products.ERP5Type.Globals import get_request
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
from
ZPublisher.HTTPRequest
import
FileUpload
from
ZPublisher.HTTPRequest
import
FileUpload
from
six.moves
import
cStringIO
as
StringIO
from
six.moves
import
cStringIO
as
StringIO
import
six
from
Products.ERP5Form.Selection
import
Selection
from
Products.ERP5Form.Selection
import
Selection
from
Products.Formulator.TALESField
import
TALESMethod
from
Products.Formulator.TALESField
import
TALESMethod
from
Products.ERP5Form.ListBox
import
ListBoxHTMLRenderer
from
Products.ERP5Form.ListBox
import
ListBoxHTMLRenderer
...
@@ -252,12 +253,16 @@ class TestListBox(ERP5TypeTestCase):
...
@@ -252,12 +253,16 @@ class TestListBox(ERP5TypeTestCase):
# We create a script to use as a list method
# We create a script to use as a list method
list_method_id
=
'ListBox_ParametersListMethod'
list_method_id
=
'ListBox_ParametersListMethod'
if
six
.
PY2
:
list_method_code
=
"""return [context.asContext(alternate_title = u'
\
xe9
lisa'.encode('utf8'))]"""
else
:
list_method_code
=
"""return [context.asContext(alternate_title = '
\
xe9
lisa')]"""
createZODBPythonScript
(
createZODBPythonScript
(
portal
.
portal_skins
.
custom
,
portal
.
portal_skins
.
custom
,
list_method_id
,
list_method_id
,
'selection=None, **kw'
,
'selection=None, **kw'
,
"""return [context.asContext(alternate_title = u'
\
xe9
lisa'.encode('utf8'))]"""
)
list_method_code
,
)
# set the listbox to use this as list method
# set the listbox to use this as list method
listbox
=
portal
.
FooModule_viewFooList
.
listbox
listbox
=
portal
.
FooModule_viewFooList
.
listbox
listbox
.
ListBox_setPropertyList
(
listbox
.
ListBox_setPropertyList
(
...
@@ -771,7 +776,8 @@ class TestListBox(ERP5TypeTestCase):
...
@@ -771,7 +776,8 @@ class TestListBox(ERP5TypeTestCase):
self
.
assertEqual
(
result
.
getStatus
(),
500
)
self
.
assertEqual
(
result
.
getStatus
(),
500
)
body
=
result
.
getBody
()
body
=
result
.
getBody
()
self
.
assertIn
(
b'Error Type: TimeoutReachedError'
,
body
)
self
.
assertIn
(
b'Error Type: TimeoutReachedError'
,
body
)
self
.
assertIn
(
b'Error Value: 1969: Query execution was interrupted (max_statement_time exceeded): SET STATEMENT'
,
body
)
self
.
assertIn
(
b'Error Value: 1969: Query execution was interrupted (max_statement_time exceeded):'
,
body
)
self
.
assertIn
(
b'SET STATEMENT max_statement_time='
,
body
)
def
test_zodb_timeout
(
self
):
def
test_zodb_timeout
(
self
):
portal
=
self
.
getPortal
()
portal
=
self
.
getPortal
()
...
...
product/ERP5Form/ListBox.py
View file @
4d6f4edd
...
@@ -1257,7 +1257,7 @@ class ListBoxRenderer:
...
@@ -1257,7 +1257,7 @@ class ListBoxRenderer:
params
.
setdefault
(
'meta_type'
,
meta_type_list
)
params
.
setdefault
(
'meta_type'
,
meta_type_list
)
# Remove FileUpload parameters
# Remove FileUpload parameters
for
k
,
v
in
params
.
items
(
):
for
k
,
v
in
list
(
params
.
items
()
):
if
k
==
"listbox"
:
if
k
==
"listbox"
:
# listbox can also contain useless parameters
# listbox can also contain useless parameters
new_list
=
[]
new_list
=
[]
...
...
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