[Erp5-report] r26377 - in /erp5/trunk/products/ERP5OOo/tests: ./ test_document/

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Apr 9 18:17:12 CEST 2009


Author: kazuhiko
Date: Thu Apr  9 18:17:11 2009
New Revision: 26377

URL: http://svn.erp5.org?rev=26377&view=rev
Log:
* support file uploading with another name in the test.
* remove duplicate test files.

Removed:
    erp5/trunk/products/ERP5OOo/tests/test_document/T&é@{T-en-002.doc
    erp5/trunk/products/ERP5OOo/tests/test_document/TEST-en-003.odt
    erp5/trunk/products/ERP5OOo/tests/test_document/TEST-fr-002.odt
Modified:
    erp5/trunk/products/ERP5OOo/tests/testDms.py
    erp5/trunk/products/ERP5OOo/tests/testIngestion.py

Modified: erp5/trunk/products/ERP5OOo/tests/testDms.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5OOo/tests/testDms.py?rev=26377&r1=26376&r2=26377&view=diff
==============================================================================
--- erp5/trunk/products/ERP5OOo/tests/testDms.py [utf8] (original)
+++ erp5/trunk/products/ERP5OOo/tests/testDms.py [utf8] Thu Apr  9 18:17:11 2009
@@ -85,8 +85,11 @@
 def makeFilePath(name):
   return os.getenv('INSTANCE_HOME') + '/../Products/ERP5OOo/tests/test_document/' + name
 
-def makeFileUpload(name):
-  return FileUpload(makeFilePath(name), name)
+def makeFileUpload(name, as_name=None):
+  if as_name is None:
+    as_name = name
+  path = makeFilePath(name)
+  return FileUpload(path, as_name)
 
 
 class TestDocument(ERP5TypeTestCase, ZopeTestCase.Functional):
@@ -447,13 +450,13 @@
     document1 = self.portal.portal_contributions.newContent(file=file)
 
     # (2) TEST, 002, fr
-    filename = 'TEST-fr-002.odt'
-    file = makeFileUpload(filename)
+    as_name = 'TEST-fr-002.odt'
+    file = makeFileUpload(filename, as_name)
     document2 = self.portal.portal_contributions.newContent(file=file)
 
     # (3) TEST, 003, en
-    filename = 'TEST-en-003.odt'
-    file = makeFileUpload(filename)
+    as_name = 'TEST-en-003.odt'
+    file = makeFileUpload(filename, as_name)
     document3 = self.portal.portal_contributions.newContent(file=file)
 
     # create docs to contain references in text_content:

Modified: erp5/trunk/products/ERP5OOo/tests/testIngestion.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5OOo/tests/testIngestion.py?rev=26377&r1=26376&r2=26377&view=diff
==============================================================================
--- erp5/trunk/products/ERP5OOo/tests/testIngestion.py [utf8] (original)
+++ erp5/trunk/products/ERP5OOo/tests/testIngestion.py [utf8] Thu Apr  9 18:17:11 2009
@@ -64,9 +64,11 @@
 def makeFilePath(name):
   return os.path.join(TEST_FILES_HOME, name)
 
-def makeFileUpload(name):
+def makeFileUpload(name, as_name=None):
+  if as_name is None:
+    as_name = name
   path = makeFilePath(name)
-  return FileUpload(path, name)
+  return FileUpload(path, as_name)
 
 class TestIngestion(ERP5TypeTestCase):
   """
@@ -1352,7 +1354,7 @@
     """
       Upload a file from contribution.
     """
-    f = makeFileUpload('T&é@{T-en-002.doc')
+    f = makeFileUpload('TEST-en-002.doc', 'T&é@{T-en-002.doc')
     document = self.portal.portal_contributions.newContent(file=f)
     sequence.edit(document_id=document.getId())
     get_transaction().commit()

Removed: erp5/trunk/products/ERP5OOo/tests/test_document/T&é@{T-en-002.doc
URL: http://svn.erp5.org/erp5/trunk/products/ERP5OOo/tests/test_document/T%26%C3%A9%40%7BT-en-002.doc?rev=26376&view=auto
==============================================================================
Binary file - no diff available.

Removed: erp5/trunk/products/ERP5OOo/tests/test_document/TEST-en-003.odt
URL: http://svn.erp5.org/erp5/trunk/products/ERP5OOo/tests/test_document/TEST-en-003.odt?rev=26376&view=auto
==============================================================================
Binary file - no diff available.

Removed: erp5/trunk/products/ERP5OOo/tests/test_document/TEST-fr-002.odt
URL: http://svn.erp5.org/erp5/trunk/products/ERP5OOo/tests/test_document/TEST-fr-002.odt?rev=26376&view=auto
==============================================================================
Binary file - no diff available.




More information about the Erp5-report mailing list