Commit c5b49bc9 authored by Nicolas Delaby's avatar Nicolas Delaby

Here we use edit instead of setFile, because only edit method set filename as source_reference.

This is a feature related to portal_contribution, sometimes filename is replaced by value provided by
rewriteIngestionData type based method.
setFile should keep value provided by portal_contribution instead of reading it from file itself.
See special parameter set_filename__ in EPR5.Tool.ContributionTool



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28977 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 324c48ca
......@@ -790,8 +790,16 @@ class TestDocument(ERP5TypeTestCase, ZopeTestCase.Functional):
def test_PDF_content_content_type(self):
upload_file = makeFileUpload('REF-en-001.pdf')
document = self.portal.document_module.newContent(portal_type='PDF',
file=upload_file)
document = self.portal.document_module.newContent(portal_type='PDF')
# Here we use edit instead of setFile,
# because only edit method set filename as source_reference.
# This is a feature related to portal_contribution,
# sometimes filename is replaced by value provided by
# rewriteIngestionData type based method.
# setFile should keep value provided by portal_contribution
# instead of reading it from file itself.
# See special parameter set_filename__ in EPR5.Tool.ContributionTool
document.edit(file=upload_file)
self.assertEquals('application/pdf', document.getContentType())
class TestDocumentWithSecurity(ERP5TypeTestCase):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment