Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5_rtl_support
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Romain Courteaud
erp5_rtl_support
Commits
44159fd4
Commit
44159fd4
authored
Mar 11, 2015
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testFields: test if proxyfield can work with datetimefield's display style
parent
ccdc558f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
product/ERP5Form/tests/testFields.py
product/ERP5Form/tests/testFields.py
+16
-3
No files found.
product/ERP5Form/tests/testFields.py
View file @
44159fd4
...
...
@@ -30,7 +30,7 @@
# TODO: Some tests from this file can be merged into Formulator
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
import
unittest
import
unittest
,
re
# Initialize ERP5Form Product to load monkey patches
...
...
@@ -758,14 +758,27 @@ class TestProxyField(ERP5TypeTestCase):
original_field
=
self
.
addField
(
self
.
container
.
Base_viewProxyFieldLibrary
,
'my_date'
,
'Date'
,
'DateTimeField'
)
original_field
.
manage_edit_xmlrpc
(
dict
(
required
=
0
))
original_field
.
manage_edit_xmlrpc
(
dict
(
input_style
=
'text'
))
proxy_field
=
self
.
addField
(
self
.
container
.
Base_view
,
'my_date'
,
'Date'
,
'ProxyField'
)
proxy_field
.
manage_edit_xmlrpc
(
dict
(
form_id
=
'Base_viewProxyFieldLibrary'
,
field_id
=
'my_date'
,))
select_matcher
=
re
.
compile
(
'select name="([^"]*)"'
)
# we can render
proxy_field
.
render
()
# and validate
result
=
proxy_field
.
render
()
#have 0 selects
self
.
assertEqual
(
0
,
len
(
select_matcher
.
findall
(
result
)))
#change input style
proxy_field
.
manage_edit_surcharged_xmlrpc
(
dict
(
input_style
=
'list'
))
# we can render
result
=
proxy_field
.
render
()
#we can change input style
#have 3 selects, for year, month, day
self
.
assertEqual
(
3
,
len
(
select_matcher
.
findall
(
result
)))
#we can validate
self
.
container
.
Base_view
.
validate_all_to_request
(
self
.
portal
.
REQUEST
)
def
test_manage_edit_surcharged_xmlrpc
(
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