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
Thomas Gambier
erp5
Commits
7cebcfeb
Commit
7cebcfeb
authored
Sep 03, 2020
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ZODB Components: erp5_ui_test: Migrate Unit Tests.
parent
a0d19fdd
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
689 additions
and
248 deletions
+689
-248
bt5/erp5_performance_test/TestTemplateItem/portal_components/test.erp5.testWorkflowPerformance.py
...em/portal_components/test.erp5.testWorkflowPerformance.py
+1
-1
bt5/erp5_ui_test/TestTemplateItem/portal_components/test.erp5.testGUIwithSecurity.py
...teItem/portal_components/test.erp5.testGUIwithSecurity.py
+2
-2
bt5/erp5_ui_test/TestTemplateItem/portal_components/test.erp5.testGUIwithSecurity.xml
...eItem/portal_components/test.erp5.testGUIwithSecurity.xml
+110
-0
bt5/erp5_ui_test/TestTemplateItem/portal_components/test.erp5.testListBox.py
...stTemplateItem/portal_components/test.erp5.testListBox.py
+7
-7
bt5/erp5_ui_test/TestTemplateItem/portal_components/test.erp5.testListBox.xml
...tTemplateItem/portal_components/test.erp5.testListBox.xml
+110
-0
bt5/erp5_ui_test/TestTemplateItem/portal_components/test.erp5.testPerformance.py
...mplateItem/portal_components/test.erp5.testPerformance.py
+227
-233
bt5/erp5_ui_test/TestTemplateItem/portal_components/test.erp5.testPerformance.xml
...plateItem/portal_components/test.erp5.testPerformance.xml
+110
-0
bt5/erp5_ui_test/TestTemplateItem/portal_components/test.erp5.testPlanningBox.py
...mplateItem/portal_components/test.erp5.testPlanningBox.py
+5
-5
bt5/erp5_ui_test/TestTemplateItem/portal_components/test.erp5.testPlanningBox.xml
...plateItem/portal_components/test.erp5.testPlanningBox.xml
+110
-0
bt5/erp5_ui_test/bt/template_test_id_list
bt5/erp5_ui_test/bt/template_test_id_list
+4
-0
bt5/erp5_ui_test/bt/test_dependency_list
bt5/erp5_ui_test/bt/test_dependency_list
+3
-0
No files found.
bt5/erp5_performance_test/TestTemplateItem/portal_components/test.erp5.testWorkflowPerformance.py
View file @
7cebcfeb
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
from
test
import
pystone
from
test
import
pystone
from
time
import
time
from
time
import
time
pystone
.
clock
=
time
pystone
.
clock
=
time
from
Products.ERP5Type.tests
.testPerformance
import
TestPerformanceMixin
from
erp5.component.test
.testPerformance
import
TestPerformanceMixin
from
Products.DCWorkflow.DCWorkflow
import
ValidationFailed
from
Products.DCWorkflow.DCWorkflow
import
ValidationFailed
from
Testing
import
ZopeTestCase
from
Testing
import
ZopeTestCase
...
...
product/ERP5Form/tests/
testGUIwithSecurity.py
→
bt5/erp5_ui_test/TestTemplateItem/portal_components/test.erp5.
testGUIwithSecurity.py
View file @
7cebcfeb
...
@@ -43,9 +43,9 @@ class TestGUISecurity(ERP5TypeTestCase):
...
@@ -43,9 +43,9 @@ class TestGUISecurity(ERP5TypeTestCase):
def
getTitle
(
self
):
def
getTitle
(
self
):
return
"Security Issues in GUI"
return
"Security Issues in GUI"
def
loginAs
(
self
,
id
=
'user'
):
def
loginAs
(
self
,
username
=
'user'
):
uf
=
self
.
getPortal
().
acl_users
uf
=
self
.
getPortal
().
acl_users
user
=
uf
.
getUser
(
id
).
__of__
(
uf
)
user
=
uf
.
getUser
(
username
).
__of__
(
uf
)
newSecurityManager
(
None
,
user
)
newSecurityManager
(
None
,
user
)
def
stepCreateObjects
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
def
stepCreateObjects
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
...
...
bt5/erp5_ui_test/TestTemplateItem/portal_components/test.erp5.testGUIwithSecurity.xml
0 → 100644
View file @
7cebcfeb
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Test Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
testGUIwithSecurity
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5Form.tests.testGUIwithSecurity
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
test.erp5.testGUIwithSecurity
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Test Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5Form/tests/
testListBox.py
→
bt5/erp5_ui_test/TestTemplateItem/portal_components/test.erp5.
testListBox.py
View file @
7cebcfeb
...
@@ -72,7 +72,7 @@ class TestListBox(ERP5TypeTestCase):
...
@@ -72,7 +72,7 @@ class TestListBox(ERP5TypeTestCase):
def
afterSetUp
(
self
):
def
afterSetUp
(
self
):
self
.
login
()
self
.
login
()
def
login
(
self
):
def
login
(
self
,
*
args
,
**
kw
):
uf
=
self
.
getPortal
().
acl_users
uf
=
self
.
getPortal
().
acl_users
uf
.
_doAddUser
(
'seb'
,
''
,
[
'Manager'
],
[])
uf
.
_doAddUser
(
'seb'
,
''
,
[
'Manager'
],
[])
user
=
uf
.
getUserById
(
'seb'
).
__of__
(
uf
)
user
=
uf
.
getUserById
(
'seb'
).
__of__
(
uf
)
...
@@ -296,13 +296,13 @@ class TestListBox(ERP5TypeTestCase):
...
@@ -296,13 +296,13 @@ class TestListBox(ERP5TypeTestCase):
],)
],)
foo_module
=
portal
.
foo_module
foo_module
=
portal
.
foo_module
o
=
foo_module
.
newContent
(
title
=
u'
\
xe9
lisa'
)
foo_module
.
newContent
(
title
=
u'
\
xe9
lisa'
)
self
.
tic
()
self
.
tic
()
request
=
get_request
()
request
=
get_request
()
request
[
'here'
]
=
portal
.
foo_module
request
[
'here'
]
=
portal
.
foo_module
try
:
try
:
rendered
=
listbox
.
get_value
(
'default'
,
render_format
=
'list'
,
REQUEST
=
request
)
listbox
.
get_value
(
'default'
,
render_format
=
'list'
,
REQUEST
=
request
)
except
UnicodeError
,
e
:
except
UnicodeError
,
e
:
self
.
fail
(
'Rendering failed: %s'
%
e
)
self
.
fail
(
'Rendering failed: %s'
%
e
)
self
.
assertIn
(
u"http://example.com/?
\
xe9
lisa"
,
listbox
.
render
(
REQUEST
=
request
))
self
.
assertIn
(
u"http://example.com/?
\
xe9
lisa"
,
listbox
.
render
(
REQUEST
=
request
))
...
@@ -330,13 +330,13 @@ class TestListBox(ERP5TypeTestCase):
...
@@ -330,13 +330,13 @@ class TestListBox(ERP5TypeTestCase):
],)
],)
foo_module
=
portal
.
foo_module
foo_module
=
portal
.
foo_module
o
=
foo_module
.
newContent
(
title
=
u'
\
xe9
lisa'
)
foo_module
.
newContent
(
title
=
u'
\
xe9
lisa'
)
self
.
tic
()
self
.
tic
()
request
=
get_request
()
request
=
get_request
()
request
[
'here'
]
=
portal
.
foo_module
request
[
'here'
]
=
portal
.
foo_module
try
:
try
:
rendered
=
listbox
.
get_value
(
'default'
,
render_format
=
'list'
,
REQUEST
=
request
)
listbox
.
get_value
(
'default'
,
render_format
=
'list'
,
REQUEST
=
request
)
except
UnicodeError
,
e
:
except
UnicodeError
,
e
:
self
.
fail
(
'Rendering failed: %s'
%
e
)
self
.
fail
(
'Rendering failed: %s'
%
e
)
self
.
assertIn
(
u"http://example.com/?
\
xe9
lisa"
,
listbox
.
render
(
REQUEST
=
request
))
self
.
assertIn
(
u"http://example.com/?
\
xe9
lisa"
,
listbox
.
render
(
REQUEST
=
request
))
...
@@ -481,7 +481,7 @@ class TestListBox(ERP5TypeTestCase):
...
@@ -481,7 +481,7 @@ class TestListBox(ERP5TypeTestCase):
# Create an new empty object with a list property
# Create an new empty object with a list property
foo_module
=
portal
.
foo_module
foo_module
=
portal
.
foo_module
o
=
foo_module
.
newContent
()
foo_module
.
newContent
()
# Reindex
# Reindex
self
.
tic
()
self
.
tic
()
...
@@ -566,7 +566,7 @@ class TestListBox(ERP5TypeTestCase):
...
@@ -566,7 +566,7 @@ class TestListBox(ERP5TypeTestCase):
# Create an new empty object with a list property
# Create an new empty object with a list property
foo_module
=
portal
.
foo_module
foo_module
=
portal
.
foo_module
o
=
foo_module
.
newContent
()
foo_module
.
newContent
()
# Reindex
# Reindex
self
.
tic
()
self
.
tic
()
...
...
bt5/erp5_ui_test/TestTemplateItem/portal_components/test.erp5.testListBox.xml
0 → 100644
View file @
7cebcfeb
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Test Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
testListBox
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5Form.tests.testListBox
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
test.erp5.testListBox
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Test Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5Type/tests/
testPerformance.py
→
bt5/erp5_ui_test/TestTemplateItem/portal_components/test.erp5.
testPerformance.py
View file @
7cebcfeb
...
@@ -26,7 +26,6 @@
...
@@ -26,7 +26,6 @@
#
#
##############################################################################
##############################################################################
import
unittest
from
time
import
time
from
time
import
time
import
gc
import
gc
import
subprocess
import
subprocess
...
@@ -120,7 +119,6 @@ PROFILER = 'pprofile'
...
@@ -120,7 +119,6 @@ PROFILER = 'pprofile'
class
TestPerformanceMixin
(
ERP5TypeTestCase
,
LogInterceptor
):
class
TestPerformanceMixin
(
ERP5TypeTestCase
,
LogInterceptor
):
def
getBusinessTemplateList
(
self
):
def
getBusinessTemplateList
(
self
):
"""
"""
Return the list of business templates.
Return the list of business templates.
...
@@ -180,9 +178,7 @@ class TestPerformanceMixin(ERP5TypeTestCase, LogInterceptor):
...
@@ -180,9 +178,7 @@ class TestPerformanceMixin(ERP5TypeTestCase, LogInterceptor):
gc
.
enable
()
gc
.
enable
()
self
.
abort
()
self
.
abort
()
class
TestPerformance
(
TestPerformanceMixin
):
class
TestPerformance
(
TestPerformanceMixin
):
def
getTitle
(
self
):
def
getTitle
(
self
):
return
"Performance"
return
"Performance"
...
@@ -195,7 +191,7 @@ class TestPerformance(TestPerformanceMixin):
...
@@ -195,7 +191,7 @@ class TestPerformance(TestPerformanceMixin):
gender
=
self
.
portal
.
portal_caches
.
clearAllCache
()
gender
=
self
.
portal
.
portal_caches
.
clearAllCache
()
self
.
tic
()
self
.
tic
()
def
checkViewBarObject
(
self
,
min
,
max
,
prefix
=
None
):
def
checkViewBarObject
(
self
,
min_
,
max_
,
prefix
=
None
):
# Some init to display form with some value
# Some init to display form with some value
if
prefix
is
None
:
if
prefix
is
None
:
prefix
=
''
prefix
=
''
...
@@ -213,7 +209,7 @@ class TestPerformance(TestPerformanceMixin):
...
@@ -213,7 +209,7 @@ class TestPerformance(TestPerformanceMixin):
self
.
tic
()
self
.
tic
()
# Check performance
# Check performance
before_view
=
time
()
before_view
=
time
()
for
x
in
xrange
(
100
):
for
_
in
xrange
(
100
):
# XXX: Note that we don't clean TransactionVariable cache and REQUEST
# XXX: Note that we don't clean TransactionVariable cache and REQUEST
# before each call to 'view' requests. In reality, they would be
# before each call to 'view' requests. In reality, they would be
# always empty at the beginning of such requests.
# always empty at the beginning of such requests.
...
@@ -224,14 +220,14 @@ class TestPerformance(TestPerformanceMixin):
...
@@ -224,14 +220,14 @@ class TestPerformance(TestPerformanceMixin):
after_view
=
time
()
after_view
=
time
()
req_time
=
(
after_view
-
before_view
)
/
100.
req_time
=
(
after_view
-
before_view
)
/
100.
print
"%s time to view object form %.4f < %.4f < %.4f
\
n
"
%
\
print
"%s time to view object form %.4f < %.4f < %.4f
\
n
"
%
\
(
prefix
,
min
,
req_time
,
max
)
(
prefix
,
min_
,
req_time
,
max_
)
if
PROFILE
:
if
PROFILE
:
self
.
profile
(
bar
.
Bar_viewPerformance
)
self
.
profile
(
bar
.
Bar_viewPerformance
)
if
DO_TEST
:
if
DO_TEST
:
self
.
assertTrue
(
min
<
req_time
<
max
,
self
.
assertTrue
(
min_
<
req_time
<
max_
,
'%.4f < %.4f < %.4f'
%
(
min
,
req_time
,
max
))
'%.4f < %.4f < %.4f'
%
(
min_
,
req_time
,
max_
))
def
test_00_viewBarObject
(
self
,
min
=
None
,
max
=
None
):
def
test_00_viewBarObject
(
self
,
min_
=
None
,
max_
=
None
):
"""
"""
Estimate average time to render object view
Estimate average time to render object view
"""
"""
...
@@ -256,7 +252,7 @@ class TestPerformance(TestPerformanceMixin):
...
@@ -256,7 +252,7 @@ class TestPerformance(TestPerformanceMixin):
for
i
in
xrange
(
10
):
for
i
in
xrange
(
10
):
def
add
():
def
add
():
for
x
in
xrange
(
100
):
for
x
in
xrange
(
100
):
p
=
self
.
bar_module
.
newContent
(
portal_type
=
'Bar'
,
self
.
bar_module
.
newContent
(
portal_type
=
'Bar'
,
title
=
'Bar Test'
,
title
=
'Bar Test'
,
quantity
=
"%4d"
%
(
x
,))
quantity
=
"%4d"
%
(
x
,))
before_add
=
time
()
before_add
=
time
()
...
@@ -274,7 +270,7 @@ class TestPerformance(TestPerformanceMixin):
...
@@ -274,7 +270,7 @@ class TestPerformance(TestPerformanceMixin):
after_tic
=
time
()
after_tic
=
time
()
gc
.
collect
()
gc
.
collect
()
before_form
=
time
()
before_form
=
time
()
for
x
in
xrange
(
100
):
for
_
in
xrange
(
100
):
self
.
bar_module
.
BarModule_viewBarList
()
self
.
bar_module
.
BarModule_viewBarList
()
after_form
=
time
()
after_form
=
time
()
# store result
# store result
...
@@ -321,7 +317,6 @@ class TestPerformance(TestPerformanceMixin):
...
@@ -321,7 +317,6 @@ class TestPerformance(TestPerformanceMixin):
MIN_TIC
,
tic_value
,
MAX_TIC
))
MIN_TIC
,
tic_value
,
MAX_TIC
))
i
+=
1
i
+=
1
def
test_viewProxyField
(
self
):
def
test_viewProxyField
(
self
):
# render a form with proxy fields: Foo_viewProxyField
# render a form with proxy fields: Foo_viewProxyField
foo
=
self
.
foo_module
.
newContent
(
foo
=
self
.
foo_module
.
newContent
(
...
@@ -337,7 +332,7 @@ class TestPerformance(TestPerformanceMixin):
...
@@ -337,7 +332,7 @@ class TestPerformance(TestPerformanceMixin):
self
.
tic
()
self
.
tic
()
# Check performance
# Check performance
before_view
=
time
()
before_view
=
time
()
for
x
in
xrange
(
100
):
for
_
in
xrange
(
100
):
foo
.
Foo_viewProxyField
()
foo
.
Foo_viewProxyField
()
after_view
=
time
()
after_view
=
time
()
req_time
=
(
after_view
-
before_view
)
/
100.
req_time
=
(
after_view
-
before_view
)
/
100.
...
@@ -368,7 +363,7 @@ class TestPerformance(TestPerformanceMixin):
...
@@ -368,7 +363,7 @@ class TestPerformance(TestPerformanceMixin):
self
.
tic
()
self
.
tic
()
# Check performance
# Check performance
before_view
=
time
()
before_view
=
time
()
for
x
in
xrange
(
100
):
for
_
in
xrange
(
100
):
foo
.
Foo_viewPerformance
()
foo
.
Foo_viewPerformance
()
after_view
=
time
()
after_view
=
time
()
req_time
=
(
after_view
-
before_view
)
/
100.
req_time
=
(
after_view
-
before_view
)
/
100.
...
@@ -387,10 +382,9 @@ class TestPerformance(TestPerformanceMixin):
...
@@ -387,10 +382,9 @@ class TestPerformance(TestPerformanceMixin):
req_time
,
req_time
,
MAX_OBJECT_MANY_LINES_VIEW
))
MAX_OBJECT_MANY_LINES_VIEW
))
class
TestPropertyPerformance
(
TestPerformanceMixin
):
class
TestPropertyPerformance
(
TestPerformanceMixin
):
def
afterSetUp
(
self
):
def
afterSetUp
(
self
):
super
(
TestPerformanceMixin
,
self
).
afterSetUp
()
super
(
TestPerformanceMixin
,
self
).
afterSetUp
()
# pylint: disable=bad-super-call
self
.
foo
=
self
.
portal
.
foo_module
.
newContent
(
self
.
foo
=
self
.
portal
.
foo_module
.
newContent
(
portal_type
=
'Foo'
,
portal_type
=
'Foo'
,
title
=
'Foo Test'
,
title
=
'Foo Test'
,
...
@@ -433,27 +427,27 @@ class TestPropertyPerformance(TestPerformanceMixin):
...
@@ -433,27 +427,27 @@ class TestPropertyPerformance(TestPerformanceMixin):
self
.
assertRaises
(
Unauthorized
,
getProperty
,
'protected_property'
)
self
.
assertRaises
(
Unauthorized
,
getProperty
,
'protected_property'
)
@
self
.
_benchmark
(
100000
,
0.0001
,
1
)
@
self
.
_benchmark
(
100000
,
0.0001
,
1
)
def
getPropertyWithRestrictedPropertyRefused
(
_
):
def
getPropertyWithRestrictedPropertyRefused
(
_
):
# pylint: disable=unused-variable
getProperty
(
'protected_property'
,
checked_permission
=
'Access contents information'
)
getProperty
(
'protected_property'
,
checked_permission
=
'Access contents information'
)
def
test_getProperty_protected_property_allowed
(
self
):
def
test_getProperty_protected_property_allowed
(
self
):
getProperty
=
self
.
foo
.
getProperty
getProperty
=
self
.
foo
.
getProperty
self
.
login
()
self
.
login
()
@
self
.
_benchmark
(
100000
,
0.0001
,
1
)
@
self
.
_benchmark
(
100000
,
0.0001
,
1
)
def
getPropertyWithRestrictedPropertyAllowed
(
_
):
def
getPropertyWithRestrictedPropertyAllowed
(
_
):
# pylint: disable=unused-variable
getProperty
(
'protected_property'
,
checked_permission
=
'Access contents information'
)
getProperty
(
'protected_property'
,
checked_permission
=
'Access contents information'
)
def
test_getProperty_simple_property
(
self
):
def
test_getProperty_simple_property
(
self
):
getProperty
=
self
.
foo
.
getProperty
getProperty
=
self
.
foo
.
getProperty
@
self
.
_benchmark
(
100000
,
0.0001
,
1
)
@
self
.
_benchmark
(
100000
,
0.0001
,
1
)
def
getPropertyWithSimpleProperty
(
_
):
def
getPropertyWithSimpleProperty
(
_
):
# pylint: disable=unused-variable
getProperty
(
'title'
,
checked_permission
=
'Access contents information'
)
getProperty
(
'title'
,
checked_permission
=
'Access contents information'
)
def
test_edit_restricted_properties
(
self
):
def
test_edit_restricted_properties
(
self
):
_edit
=
self
.
foo
.
edit
_edit
=
self
.
foo
.
edit
self
.
login
()
self
.
login
()
@
self
.
_benchmark
(
10000
,
0.0001
,
1
)
@
self
.
_benchmark
(
10000
,
0.0001
,
1
)
def
edit
(
i
):
def
edit
(
i
):
# pylint: disable=unused-variable
_edit
(
_edit
(
title
=
str
(
i
),
title
=
str
(
i
),
protected_property
=
str
(
i
)
protected_property
=
str
(
i
)
...
...
bt5/erp5_ui_test/TestTemplateItem/portal_components/test.erp5.testPerformance.xml
0 → 100644
View file @
7cebcfeb
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Test Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
testPerformance
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5Type.tests.testPerformance
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
test.erp5.testPerformance
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Test Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5Form/tests/
testPlanningBox.py
→
bt5/erp5_ui_test/TestTemplateItem/portal_components/test.erp5.
testPlanningBox.py
View file @
7cebcfeb
...
@@ -60,7 +60,7 @@ class TestPlanningBox(ERP5TypeTestCase):
...
@@ -60,7 +60,7 @@ class TestPlanningBox(ERP5TypeTestCase):
def
afterSetUp
(
self
):
def
afterSetUp
(
self
):
self
.
login
()
self
.
login
()
def
login
(
self
):
def
login
(
self
,
*
args
,
**
kw
):
uf
=
self
.
getPortal
().
acl_users
uf
=
self
.
getPortal
().
acl_users
uf
.
_doAddUser
(
'seb'
,
''
,
[
'Manager'
],
[])
uf
.
_doAddUser
(
'seb'
,
''
,
[
'Manager'
],
[])
user
=
uf
.
getUserById
(
'seb'
).
__of__
(
uf
)
user
=
uf
.
getUserById
(
'seb'
).
__of__
(
uf
)
...
@@ -125,7 +125,7 @@ class TestPlanningBox(ERP5TypeTestCase):
...
@@ -125,7 +125,7 @@ class TestPlanningBox(ERP5TypeTestCase):
self
.
assertEqual
(
sec_axis_info
[
'bound_start'
],
today
)
self
.
assertEqual
(
sec_axis_info
[
'bound_start'
],
today
)
self
.
assertEqual
(
sec_axis_info
[
'bound_stop'
],
today
+
1
)
self
.
assertEqual
(
sec_axis_info
[
'bound_stop'
],
today
+
1
)
for
tree_list
,
activity_list
,
stat
in
basic
.
report_group_list
:
for
_
,
activity_list
,
_
in
basic
.
report_group_list
:
self
.
assertEqual
(
len
(
activity_list
),
1
)
self
.
assertEqual
(
len
(
activity_list
),
1
)
...
...
bt5/erp5_ui_test/TestTemplateItem/portal_components/test.erp5.testPlanningBox.xml
0 → 100644
View file @
7cebcfeb
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Test Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
testPlanningBox
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5Form.tests.testPlanningBox
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
test.erp5.testPlanningBox
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Test Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_ui_test/bt/template_test_id_list
View file @
7cebcfeb
test.erp5.testGUIwithSecurity
test.erp5.testListBox
test.erp5.testPerformance
test.erp5.testPlanningBox
test.erp5.testRelationField
test.erp5.testRelationField
\ No newline at end of file
bt5/erp5_ui_test/bt/test_dependency_list
0 → 100644
View file @
7cebcfeb
erp5_full_text_mroonga_catalog
erp5_core_proxy_field_legacy
erp5_base
\ No newline at end of file
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