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
Titouan Soulard
erp5
Commits
edf87682
Commit
edf87682
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
8ce12b78
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 @
edf87682
...
...
@@ -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