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
Binh
erp5
Commits
93ba4da3
Commit
93ba4da3
authored
Jun 02, 2016
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testERP5WebWithDms: add web page implicit successor tests
parent
7722657f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
0 deletions
+53
-0
product/ERP5/tests/testERP5WebWithDms.py
product/ERP5/tests/testERP5WebWithDms.py
+53
-0
No files found.
product/ERP5/tests/testERP5WebWithDms.py
View file @
93ba4da3
...
@@ -1533,6 +1533,59 @@ return True
...
@@ -1533,6 +1533,59 @@ return True
else
:
else
:
raise
ValueError
(
"unhandled encoding %r"
%
encoding
)
raise
ValueError
(
"unhandled encoding %r"
%
encoding
)
@
customScript
(
"ERP5Site_getWebSiteDomainDict"
,
""
,
"""return {
"test.portal.erp": context.getPortalObject(),
"test.site.erp": context.getPortalObject().web_site_module.test,
}"""
)
def
test_WebPageImplicitSuccessorValueList
(
self
):
# Test init part
# XXX use web site domain properties instead of @customScript
web_site
=
self
.
setupWebSite
()
web_page_module
=
self
.
portal
.
getDefaultModule
(
portal_type
=
"Web Page"
)
image_module
=
self
.
portal
.
getDefaultModule
(
portal_type
=
"Image"
)
img_list
=
[]
for
i
in
range
(
13
):
img
=
image_module
.
newContent
(
data
=
XSMALL_SVG_IMAGE_ICON_DATA
,
reference
=
"P-IMG-implicit.successor.value.list.test.%d"
%
i
,
version
=
"001"
,
language
=
"en"
,
)
img
.
publish
()
img_list
.
append
(
img
)
page
=
web_page_module
.
newContent
(
reference
=
"P-WP-implicit.successor.value.list.test"
,
version
=
"001"
,
language
=
"en"
,
text_content
=
""
.
join
([
"<p>Hello</p>"
,
'<a href="%s" />'
%
img_list
[
0
].
getRelativeUrl
(),
'<a href="%s" />'
%
img_list
[
0
].
getRelativeUrl
(),
'<a href="./%s" />'
%
img_list
[
1
].
getRelativeUrl
(),
'<a href="/%s" />'
%
img_list
[
2
].
getRelativeUrl
(),
'<a href="%s/view" />'
%
img_list
[
3
].
getRelativeUrl
(),
'<a href="P-IMG-implicit.successor.value.list.test.4" />'
,
'<a href="./P-IMG-implicit.successor.value.list.test.5" />'
,
'<a href="./P-IMG-implicit.successor.value.list.test.6/view" />'
,
'<a href="/P-IMG-implicit.successor.value.list.test.7/view" />'
,
'<a href="//test.site.erp/P-IMG-implicit.successor.value.list.test.8/view" />'
,
'<a href="http://test.site.erp/P-IMG-implicit.successor.value.list.test.9/view" />'
,
'<img src="P-IMG-implicit.successor.value.list.test.10?format=" />'
,
'<iframe src="/%s" />'
%
img_list
[
11
].
getRelativeUrl
(),
'<style>body { background-image: url("P-IMG-implicit.successor.value.list.test.12?format=png"); }</style>'
,
]),
)
page
.
publish
()
self
.
tic
()
# Test part
successor_list
=
self
.
portal
.
web_site_module
.
test
\
.
restrictedTraverse
(
"P-WP-implicit.successor.value.list.test"
)
\
.
getImplicitSuccessorValueList
()
self
.
assertEqual
(
sorted
([
s
.
getUid
()
for
s
in
successor_list
]),
sorted
([
i
.
getUid
()
for
i
in
img_list
]),
)
def
test_suite
():
def
test_suite
():
suite
=
unittest
.
TestSuite
()
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
TestERP5WebWithDms
))
suite
.
addTest
(
unittest
.
makeSuite
(
TestERP5WebWithDms
))
...
...
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