Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
preetwinder
erp5
Commits
1ad62b2b
Commit
1ad62b2b
authored
12 years ago
by
Ivan Tyagov
Browse files
Options
Download
Email Patches
Plain Diff
Test that embedded in Web Page's content relative images get auto converted.
parent
edc48778
Changes
1
Hide 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
))
...
...
This diff is collapsed.
Click to expand it.
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