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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
erp5
Commits
1ad62b2b
Commit
1ad62b2b
authored
Oct 11, 2012
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test that embedded in Web Page's content relative images get auto converted.
parent
edc48778
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
1 deletion
+26
-1
product/ERP5OOo/tests/testDmsWithPreConversion.py
product/ERP5OOo/tests/testDmsWithPreConversion.py
+26
-1
No files found.
product/ERP5OOo/tests/testDmsWithPreConversion.py
View file @
1ad62b2b
...
...
@@ -28,7 +28,7 @@
##############################################################################
import
unittest
from
testDms
import
TestDocument
from
testDms
import
TestDocument
,
makeFileUpload
class
TestDocumentWithPreConversion
(
TestDocument
):
"""
...
...
@@ -40,6 +40,31 @@ class TestDocumentWithPreConversion(TestDocument):
def
getTitle
(
self
):
return
"DMS with Preconversion"
def
test_preConvertedEmbeddedImageInWebPageContent
(
self
):
# create an image
upload_file
=
makeFileUpload
(
'cmyk_sample.jpg'
)
image
=
self
.
portal
.
image_module
.
newContent
(
portal_type
=
'Image'
,
reference
=
'Embedded-XXX'
,
version
=
'001'
,
language
=
'en'
)
image
.
edit
(
file
=
upload_file
)
image
.
publish
()
self
.
tic
()
web_page
=
self
.
portal
.
web_page_module
.
newContent
(
portal_type
=
"Web Page"
)
web_page
.
setTextContent
(
'''<b> test </b>
<img src="Embedded-XXX?format=png&display=large&quality=75"/>
<img src="Embedded-XXX?format=jpeg&display=large&quality=75"/>'''
)
self
.
tic
()
# check that referenced in Web Page's content image(s) is well converted
self
.
assertTrue
(
image
.
hasConversion
(
**
{
'format'
:
'jpeg'
,
'display'
:
'large'
,
'quality'
:
75
}))
self
.
assertTrue
(
image
.
hasConversion
(
**
{
'format'
:
'png'
,
'display'
:
'large'
,
'quality'
:
75
}))
self
.
assertSameSet
([
'Embedded-XXX?format=png&display=large&quality=75'
,
\
'Embedded-XXX?format=jpeg&display=large&quality=75'
],
web_page
.
Base_extractImageUrlList
())
def
test_suite
():
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
TestDocumentWithPreConversion
))
...
...
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