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
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Lu Xu
erp5
Commits
8697ba5b
Commit
8697ba5b
authored
Jun 09, 2011
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add site map script testing.
parent
508896a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
0 deletions
+44
-0
product/ERP5/tests/testERP5Web.py
product/ERP5/tests/testERP5Web.py
+44
-0
No files found.
product/ERP5/tests/testERP5Web.py
View file @
8697ba5b
...
...
@@ -1322,6 +1322,50 @@ Hé Hé Hé!""", page.asText().strip())
self
.
assertTrue
(
'<cite>foo</cite>'
in
web_page
.
asEntireHTML
(
charset
=
'utf-8'
))
self
.
assertTrue
(
'<cite>foo</cite>'
in
web_page
.
asEntireHTML
())
def
test_21_WebSiteMap
(
self
):
"""
Test Web Site map script.
"""
portal
=
self
.
getPortal
()
request
=
self
.
app
.
REQUEST
website
=
self
.
setupWebSite
()
kw
=
{
'depth'
:
5
,
'include_subsection'
:
1
}
website
.
setSiteMapSectionParent
(
1
)
websection1
=
website
.
newContent
(
portal_type
=
'Web Section'
,
title
=
'Section 1'
,
site_map_section_parent
=
1
,
visible
=
1
)
websection1_1
=
websection1
.
newContent
(
portal_type
=
'Web Section'
,
title
=
'Section 1.1'
,
site_map_section_parent
=
1
,
visible
=
1
)
self
.
stepTic
()
site_map
=
website
.
WebSection_getSiteMapTree
(
depth
=
5
,
include_subsection
=
1
)
self
.
assertSameSet
([
websection1
.
getTitle
()],
[
x
[
'translated_title'
]
for
x
in
site_map
])
self
.
assertSameSet
([
websection1_1
.
getTitle
()],
[
x
[
'translated_title'
]
for
x
in
site_map
[
0
][
'subsection'
]])
self
.
assertEqual
(
1
,
site_map
[
0
][
'level'
])
self
.
assertEqual
(
2
,
site_map
[
0
][
'subsection'
][
0
][
'level'
])
# check depth works
site_map
=
website
.
WebSection_getSiteMapTree
(
depth
=
1
,
include_subsection
=
1
)
self
.
assertEqual
(
None
,
site_map
[
0
][
'subsection'
])
self
.
assertSameSet
([
websection1
.
getTitle
()],
[
x
[
'translated_title'
]
for
x
in
site_map
])
# hide subsections
websection1_1
.
setSiteMapSectionParent
(
0
)
websection1_1
.
setVisible
(
0
)
self
.
stepTic
()
site_map
=
website
.
WebSection_getSiteMapTree
(
depth
=
5
,
include_subsection
=
1
)
self
.
assertSameSet
([
websection1
.
getTitle
()],
[
x
[
'translated_title'
]
for
x
in
site_map
])
self
.
assertEqual
(
None
,
site_map
[
0
][
'subsection'
])
class
TestERP5WebWithSimpleSecurity
(
ERP5TypeTestCase
):
"""
...
...
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