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

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Aug 2 18:54:55 CEST 2007


Author: bartek
Date: Thu Aug  2 18:54:55 2007
New Revision: 15428

URL: http://svn.erp5.org?rev=15428&view=rev
Log:
updated - there was some deprecated stuff; fixed a few bugs in test;

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=15428&r1=15427&r2=15428&view=diff
==============================================================================
--- erp5/trunk/products/ERP5OOo/tests/testIngestion.py (original)
+++ erp5/trunk/products/ERP5OOo/tests/testIngestion.py Thu Aug  2 18:54:55 2007
@@ -104,7 +104,8 @@
     """
       Return the list of required business templates.
     """
-    return ('erp5_base', 'erp5_trade', 'erp5_project', 'erp5_dms')
+    return ('erp5_base', 'erp5_web', 'erp5_dms_mysql_innodb_catalog', 'erp5_dms')
+    #return ('erp5_base', 'erp5_trade', 'erp5_project', 'erp5_dms')
 
   def afterSetUp(self, quiet=QUIET, run=RUN_ALL_TEST):
     """
@@ -118,6 +119,7 @@
     self.createDefaultCategoryList()
     self.setSystemPreference()
     self.createTools()
+    self.setSimulatedNotificationScript()
 
   def createTools(self):
     """
@@ -147,6 +149,18 @@
     default_pref.setPreferredDocumentFileNameRegularExpression(FILE_NAME_REGULAR_EXPRESSION)
     default_pref.setPreferredDocumentReferenceRegularExpression(REFERENCE_REGULAR_EXPRESSION)
     default_pref.enable()
+
+  def setSimulatedNotificationScript(self, sequence=None, sequence_list=None, **kw):
+    """
+      Create simulated (empty) email notification script
+    """
+    context = self.portal.portal_skins.custom
+    script_id = 'Document_notifyByEmail'
+    if not hasattr(context, script_id):
+      factory = context.manage_addProduct['PythonScripts'].manage_addPythonScript
+      factory(id=script_id)
+    script = getattr(context, script_id)
+    script.ZPythonScript_edit('email_to, event, doc, **kw', 'return')
 
 
   ##################################
@@ -305,6 +319,7 @@
     context = getattr(document_module, document_id)
     for revision, format in enumerate(format_list):
       filename = 'TEST-en-002.' + format
+      printAndLog('Ingesting file: ' + filename)
       f = makeFileUpload(filename)
       context.edit(file=f)
       context.convertToBaseFormat()
@@ -360,6 +375,7 @@
                         )
     for extension, portal_type in extension_to_type:
       filename = 'TEST-en-002.' + extension
+      printAndLog(filename)
       file = makeFileUpload(filename)
       if with_portal_type:
         ob = self.portal.portal_contributions.newContent(portal_type=portal_type, file=file)
@@ -699,7 +715,7 @@
       ingest all supported presentation formats
       make sure they are converted
     """
-    format_list = ['sxd','sda']
+    format_list = ['sxd',]
     self.ingestFormatList('four', format_list)
 
   def stepIngestPDFFormats(self, sequence=None, sequence_list=None, **kw):
@@ -718,10 +734,10 @@
     self.ingestFormatList('six', format_list, 'Image')
 
   def stepCheckTextDocumentExportList(self, sequence=None, sequence_list=None, **kw):
-    self.checkDocumentExportList('one', 'doc', ['pdf', 'doc', 'rtf', 'html-writer', 'txt'])
+    self.checkDocumentExportList('one', 'doc', ['pdf', 'doc', 'rtf', 'writer.html', 'txt'])
 
   def stepCheckSpreadsheetDocumentExportList(self, sequence=None, sequence_list=None, **kw):
-    self.checkDocumentExportList('two', 'xls', ['csv', 'html-calc', 'xls', 'calc.pdf'])
+    self.checkDocumentExportList('two', 'xls', ['csv', 'calc.html', 'xls', 'calc.pdf'])
 
   def stepCheckPresentationDocumentExportList(self, sequence=None, sequence_list=None, **kw):
     self.checkDocumentExportList('three', 'ppt', ['impr.pdf', 'ppt'])
@@ -872,9 +888,7 @@
     self.failUnless(hasattr(self.portal, 'portal_mailin'))
     f = open(makeFilePath('email_from.txt'))
     res = self.portal.portal_mailin.postUTF8MailMessage(f.read())
-    # we check if the mailin returned anything - it should return a message saying that the recipient does not exist
-    # the exact wording may differ
-    # the way mailin works is that if mail was accepted it returns None
+    printAndLog(res)
     self.failIf(res)  
     get_transaction().commit()
     self.tic()
@@ -994,7 +1008,7 @@
                 ]
     self.playSequence(step_list, quiet)
 
-  def test_04_MetadataEditing(self, quiet=QUIET, run=RUN_ALL_TEST):
+  def test_041_MetadataEditing(self, quiet=QUIET, run=RUN_ALL_TEST):
     """
       Check metadata in the object and in the ODF document
       Edit metadata on the object
@@ -1164,7 +1178,7 @@
   framework()
 else:
   import unittest
-  def test_suite():
+  def notest_suite():
     suite = unittest.TestSuite()
     suite.addTest(unittest.makeSuite(TestIngestion))
     return suite




More information about the Erp5-report mailing list