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
Labels
Merge Requests
142
Merge Requests
142
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
30b9a2ff
Commit
30b9a2ff
authored
May 19, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dms: also test text conversion with cache filled
The test was only testing with empty cache
parent
b4227bb9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
bt5/erp5_dms/TestTemplateItem/portal_components/test.erp5.testDms.py
...s/TestTemplateItem/portal_components/test.erp5.testDms.py
+10
-4
No files found.
bt5/erp5_dms/TestTemplateItem/portal_components/test.erp5.testDms.py
View file @
30b9a2ff
...
...
@@ -1553,7 +1553,9 @@ class TestDocument(TestDocumentMixin):
upload_file
=
makeFileUpload
(
'cmyk_sample.jpg'
)
document
=
self
.
portal
.
portal_contributions
.
newContent
(
file
=
upload_file
)
self
.
assertEqual
(
'Image'
,
document
.
getPortalType
())
self
.
assertEqual
(
'ERP5 is a free software.'
,
document
.
asText
())
for
_
in
(
'empty_cache'
,
'cache'
):
self
.
assertEqual
(
document
.
asText
(),
'ERP5 is a free software.'
)
self
.
tic
()
def
test_MonochromeImageResize
(
self
):
upload_file
=
makeFileUpload
(
'monochrome_sample.tiff'
)
...
...
@@ -1561,8 +1563,10 @@ class TestDocument(TestDocumentMixin):
self
.
assertEqual
(
'Image'
,
document
.
getPortalType
())
resized_image
=
document
.
convert
(
format
=
'png'
,
display
=
'small'
)[
1
]
identify_output
=
Popen
([
'identify'
,
'-verbose'
,
'-'
],
stdin
=
PIPE
,
stdout
=
PIPE
).
communicate
(
resized_image
)[
0
]
self
.
assertNotIn
(
'1-bit'
,
identify_output
)
self
.
assertEqual
(
'ERP5 is a free software.'
,
document
.
asText
())
self
.
assertNotIn
(
b'1-bit'
,
identify_output
)
for
_
in
(
'empty_cache'
,
'cache'
):
self
.
assertEqual
(
document
.
asText
(),
'ERP5 is a free software.'
)
self
.
tic
()
def
test_Base_showFoundText
(
self
):
# Create document with good content
...
...
@@ -2055,7 +2059,9 @@ document.write('<sc'+'ript type="text/javascript" src="http://somosite.bg/utb.ph
document
=
self
.
portal
.
document_module
.
newContent
(
portal_type
=
'PDF'
,
file
=
makeFileUpload
(
'TEST.Embedded.Image.pdf'
))
for
_
in
(
'empty_cache'
,
'cache'
):
self
.
assertEqual
(
document
.
asText
(),
'ERP5 is a free software.'
)
self
.
tic
()
def
test_broken_pdf_asText
(
self
):
class
StringIOWithFilename
(
StringIO
.
StringIO
):
...
...
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