From 04e9ea3bf5219b880eafbd4e1d6f64bbd8641e40 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Tue, 2 Feb 2010 14:51:34 +0000
Subject: [PATCH] If there are more than one path defined in the category
 upload spreadsheets (for instance more than one * in paths columns), this is
 an error that should be reported.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32186 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5OOo/tests/testOOoImport.py           |  13 +++++++++++++
 .../import_region_category_multiple_paths.ods    | Bin 0 -> 7990 bytes
 2 files changed, 13 insertions(+)
 create mode 100644 product/ERP5OOo/tests/test_document/import_region_category_multiple_paths.ods

diff --git a/product/ERP5OOo/tests/testOOoImport.py b/product/ERP5OOo/tests/testOOoImport.py
index fc451bcaae..147f061990 100644
--- a/product/ERP5OOo/tests/testOOoImport.py
+++ b/product/ERP5OOo/tests/testOOoImport.py
@@ -960,6 +960,19 @@ class TestOOoImport(ERP5TypeTestCase):
     else:
       self.fail('ValueError not raised')
 
+  def test_Base_getCategoriesSpreadSheetMapping_MultiplePaths(self):
+    # If multiple paths is defined (for instance more than one * in paths
+    # columns), then it should be an error and the error must be reported
+    import_file = makeFileUpload(
+        'import_region_category_multiple_paths.ods')
+    try:
+      self.portal.portal_categories.Base_getCategoriesSpreadSheetMapping(
+             import_file=import_file)
+    except ValueError, error:
+      self.assertTrue('More that one path is defined' in str(error), str(error))
+    else:
+      self.fail('ValueError not raised')
+
   def test_Base_getCategoriesSpreadSheetMapping_Id_is_reserved_property_name(self):
     # tests Base_getCategoriesSpreadSheetMapping reserved property name are only test for path column, not all.
     import_file = makeFileUpload(
diff --git a/product/ERP5OOo/tests/test_document/import_region_category_multiple_paths.ods b/product/ERP5OOo/tests/test_document/import_region_category_multiple_paths.ods
new file mode 100644
index 0000000000000000000000000000000000000000..63196f75d1a33d637d01af457a10a56321d9261e
GIT binary patch
literal 7990
zcmb7J1z1$w)+Pl31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