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
Frederic Thoma
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
Show 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):
...
@@ -1341,6 +1341,22 @@ class TestDocument(TestDocumentMixin):
self
.
commit
()
self
.
commit
()
self
.
tic
()
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
):
def
test_PDF_content_content_type
(
self
):
upload_file
=
makeFileUpload
(
'REF-en-001.pdf'
)
upload_file
=
makeFileUpload
(
'REF-en-001.pdf'
)
document
=
self
.
portal
.
document_module
.
newContent
(
portal_type
=
'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