Commit 7f5f53e6 authored by Jérome Perrin's avatar Jérome Perrin

test that the script to import categories from a spreadsheet does not silently

ignore duplicate IDs


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24905 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d3379bc3
......@@ -304,6 +304,20 @@ class TestOOoImport(ERP5TypeTestCase):
self.assertEquals(['france'], list(region.europe.france.europe.objectIds()))
self.assertEquals([], list(region.europe.france.europe.france.objectIds()))
def test_CategoryTool_importCategoryFile_DuplicateIdsAtSameLevel(self):
# tests CategoryTool_importCategoryFile when a document contain same
# categories ID at the same level, in that case, a ValueError is raised
import_file = makeFileUpload(
'import_region_category_duplicate_ids_same_level.sxc')
try:
self.portal.portal_categories.CategoryTool_importCategoryFile(
import_file=import_file)
except ValueError, error:
# 'france' is the duplicate ID in this spreadsheet
self.assertTrue('france' in str(error), str(error))
else:
self.fail('ValueError not raised')
# simple OOoParser tests
def test_getSpreadSheetMapping(self):
parser = OOoParser()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment