Commit 47fa7f82 authored by Nicolas Delaby's avatar Nicolas Delaby

Check that file_name provided by the user take precedence

on filename's file
Reviewed by Jerome


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32052 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 21295982
...@@ -1430,6 +1430,21 @@ class TestIngestion(ERP5TypeTestCase): ...@@ -1430,6 +1430,21 @@ class TestIngestion(ERP5TypeTestCase):
self.assertEquals(1, self.assertEquals(1,
len(portal.portal_catalog(path=contribution_tool.getPath()))) len(portal.portal_catalog(path=contribution_tool.getPath())))
def test_15_TestFileNameDiscovery(self):
"""Test that filename is well set in source_reference
- filename can we discovery from file
- filename can be pass as argument by the user
"""
portal = self.portal
contribution_tool = getToolByName(portal, 'portal_contributions')
file_object = makeFileUpload('TEST-en-002.doc')
document = contribution_tool.newContent(file=file_object)
self.assertEquals(document.getSourceReference(), 'TEST-en-002.doc')
my_filename = 'Something.doc'
document = contribution_tool.newContent(file=file_object,
file_name=my_filename)
self.assertEquals(document.getSourceReference(), my_filename)
# Missing tests # Missing tests
""" """
property_dict = context.getPropertyDictFromUserLogin() property_dict = context.getPropertyDictFromUserLogin()
......
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