[Erp5-report] r32052 nicolas - /erp5/trunk/products/ERP5OOo/tests/testIngestion.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Jan 28 11:21:16 CET 2010


Author: nicolas
Date: Thu Jan 28 11:21:13 2010
New Revision: 32052

URL: http://svn.erp5.org?rev=32052&view=rev
Log:
Check that file_name provided by the user take precedence
on filename's file
Reviewed by Jerome

Modified:
    erp5/trunk/products/ERP5OOo/tests/testIngestion.py

Modified: erp5/trunk/products/ERP5OOo/tests/testIngestion.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5OOo/tests/testIngestion.py?rev=32052&r1=32051&r2=32052&view=diff
==============================================================================
--- erp5/trunk/products/ERP5OOo/tests/testIngestion.py [utf8] (original)
+++ erp5/trunk/products/ERP5OOo/tests/testIngestion.py [utf8] Thu Jan 28 11:21:13 2010
@@ -1430,6 +1430,21 @@
     self.assertEquals(1,
         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
 """
     property_dict = context.getPropertyDictFromUserLogin()




More information about the Erp5-report mailing list