Commit 151d30cb authored by Jérome Perrin's avatar Jérome Perrin

tests that wrong hierarchy are detected


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24921 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ceab69ca
......@@ -333,6 +333,19 @@ class TestOOoImport(ERP5TypeTestCase):
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):
......
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