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
139
Merge Requests
139
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
6d68b19b
Commit
6d68b19b
authored
Jan 16, 2023
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web: add test for WebSection_getEventResourceItemList
parent
fa5e107e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
bt5/erp5_web/TestTemplateItem/portal_components/test.erp5.testERP5Web.py
...stTemplateItem/portal_components/test.erp5.testERP5Web.py
+27
-0
No files found.
bt5/erp5_web/TestTemplateItem/portal_components/test.erp5.testERP5Web.py
View file @
6d68b19b
...
...
@@ -1612,6 +1612,33 @@ Hé Hé Hé!""", page.asText().strip())
self
.
assertNotIn
(
b'<h1>Hello !</h1>'
,
resp
.
getBody
())
def
test_web_section_get_resource_item
(
self
):
portal
=
self
.
getPortalObject
()
preference
=
getattr
(
portal
.
portal_preferences
,
'test_site_preference'
,
None
)
if
preference
is
None
:
preference
=
portal
.
portal_preferences
.
newContent
(
portal_type
=
'System Preference'
,
title
=
'Default Site Preference'
,
id
=
'test_site_preference'
)
if
preference
.
getPreferenceState
()
==
'disabled'
:
preference
.
enable
()
for
category_id
in
[
'test_use_category'
,
'test_use_category_2'
]:
if
not
getattr
(
portal
.
portal_categories
.
use
,
category_id
,
None
):
portal
.
portal_categories
.
use
.
newContent
(
portal_type
=
'Category'
,
title
=
category_id
,
id
=
category_id
)
test_product
=
getattr
(
portal
.
product_module
,
'test_product'
,
None
)
if
not
test_product
:
test_product
=
portal
.
newContent
(
portal_type
=
'Product'
,
id
=
'test_product'
,
title
=
'Test Product'
,
use
=
'test_use_category'
)
if
test_product
.
getValidationState
()
==
"draft"
:
test_product
.
validate
()
preference
.
setPreferredEventUseList
([
'test_use_category'
])
web_site
=
self
.
web_site_module
.
newContent
(
portal_type
=
'Web Site'
)
self
.
tic
()
self
.
assertEqual
(
web_site
.
WebSection_getEventResourceItemList
(),
[(
''
,
''
),(
'Test Product'
,
'test_product'
)])
preference
.
setPreferredEventUseList
([
'test_use_category_2'
])
self
.
tic
()
self
.
assertEqual
(
web_site
.
WebSection_getEventResourceItemList
(),
[(
''
,
''
)])
class
TestERP5WebWithSimpleSecurity
(
ERP5TypeTestCase
):
"""
Test for erp5_web with simple security.
...
...
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