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

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Dec 17 13:08:33 CET 2008


Author: jerome
Date: Wed Dec 17 13:08:28 2008
New Revision: 24921

URL: http://svn.erp5.org?rev=24921&view=rev
Log:
tests that wrong hierarchy are detected

Added:
    erp5/trunk/products/ERP5OOo/tests/test_document/import_region_category_wrong_hierarchy.sxc   (with props)
Modified:
    erp5/trunk/products/ERP5OOo/tests/testOOoImport.py

Modified: erp5/trunk/products/ERP5OOo/tests/testOOoImport.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5OOo/tests/testOOoImport.py?rev=24921&r1=24920&r2=24921&view=diff
==============================================================================
--- erp5/trunk/products/ERP5OOo/tests/testOOoImport.py [utf8] (original)
+++ erp5/trunk/products/ERP5OOo/tests/testOOoImport.py [utf8] Wed Dec 17 13:08:28 2008
@@ -333,6 +333,19 @@
     self.assertEquals(1, len(message_list))
     self.assertTrue('france' in str(message_list[0]))
 
+  def test_Base_getCategoriesSpreadSheetMapping_WrongHierarchy(self):
+    # tests Base_getCategoriesSpreadSheetMapping when the spreadsheet has an
+    # invalid hierarchy (#788)
+    import_file = makeFileUpload(
+        'import_region_category_wrong_hierarchy.sxc')
+    try:
+      self.portal.portal_categories.Base_getCategoriesSpreadSheetMapping(
+             import_file=import_file)
+    except ValueError, error:
+      # 'wrong_hierarchy' is the ID of the category where the problem happens
+      self.assertTrue('wrong_hierarchy' in str(error), str(error))
+    else:
+      self.fail('ValueError not raised')
 
   # simple OOoParser tests
   def test_getSpreadSheetMapping(self):

Added: erp5/trunk/products/ERP5OOo/tests/test_document/import_region_category_wrong_hierarchy.sxc
URL: http://svn.erp5.org/erp5/trunk/products/ERP5OOo/tests/test_document/import_region_category_wrong_hierarchy.sxc?rev=24921&view=auto
==============================================================================
Binary file - no diff available.

Propchange: erp5/trunk/products/ERP5OOo/tests/test_document/import_region_category_wrong_hierarchy.sxc
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream




More information about the Erp5-report mailing list