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
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
c2e0c501
Commit
c2e0c501
authored
Oct 10, 2013
by
Aurel
Committed by
Kazuhiko Shiozaki
Oct 15, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test wrongly formatted pdf file
parent
2e109f94
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
product/ERP5OOo/tests/testDms.py
product/ERP5OOo/tests/testDms.py
+16
-0
product/ERP5OOo/tests/test_document/FEUILLE BLANCHE.pdf
product/ERP5OOo/tests/test_document/FEUILLE BLANCHE.pdf
+0
-0
No files found.
product/ERP5OOo/tests/testDms.py
View file @
c2e0c501
...
...
@@ -1341,6 +1341,22 @@ class TestDocument(TestDocumentMixin):
self
.
commit
()
self
.
tic
()
def
test_upload_bad_pdf_file
(
self
):
""" Test that pypdf2 handle wrong formatted PDF """
path
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'test_document'
,
'FEUILLE BLANCHE.pdf'
)
file_upload
=
FileUpload
(
path
,
'FEUILLE BLANCHE.pdf'
)
pdf
=
self
.
portal
.
document_module
.
newContent
(
portal_type
=
'PDF'
,
file
=
file_upload
,
title
=
'Bad PDF'
)
self
.
tic
()
pdf
.
share
()
self
.
tic
()
self
.
assertEquals
(
pdf
.
getValidationState
(),
"shared"
)
result
=
pdf
.
getContentInformation
()
self
.
assertNotEquals
(
result
,
None
)
def
test_PDF_content_content_type
(
self
):
upload_file
=
makeFileUpload
(
'REF-en-001.pdf'
)
document
=
self
.
portal
.
document_module
.
newContent
(
portal_type
=
'PDF'
)
...
...
product/ERP5OOo/tests/test_document/FEUILLE BLANCHE.pdf
0 → 100644
View file @
c2e0c501
File added
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