[Erp5-report] r20801 - in /erp5/trunk/products/ERP5OOo/tests: ./ test_document/
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Apr 24 17:25:26 CEST 2008
Author: jerome
Date: Thu Apr 24 17:25:25 2008
New Revision: 20801
URL: http://svn.erp5.org?rev=20801&view=rev
Log:
test the import from categories when path is defined using *, and when there
are duplicated ids in the hierarchy
Added:
erp5/trunk/products/ERP5OOo/tests/test_document/import_region_category_duplicate_ids.sxc (with props)
erp5/trunk/products/ERP5OOo/tests/test_document/import_region_category_path_stars.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=20801&r1=20800&r2=20801&view=diff
==============================================================================
--- erp5/trunk/products/ERP5OOo/tests/testOOoImport.py (original)
+++ erp5/trunk/products/ERP5OOo/tests/testOOoImport.py Thu Apr 24 17:25:25 2008
@@ -229,6 +229,39 @@
self.assertEquals('A Country', france.getDescription())
self.assertEquals('FR', france.getCodification())
self.assertEquals(1, france.getIntIndex())
+
+ def test_CategoryTool_importCategoryFile_PathStars(self):
+ # tests CategoryTool_importCategoryFile with * in the paths columns
+ self.portal.portal_categories.CategoryTool_importCategoryFile(
+ import_file=makeFileUpload('import_region_category_path_stars.sxc'))
+ get_transaction().commit()
+ self.tic()
+ region = self.portal.portal_categories.region
+ self.assertEqual(2, len(region))
+ self.assertTrue('europe' in region.objectIds())
+ self.assertTrue('germany' in region.europe.objectIds())
+ self.assertTrue('france' in region.europe.objectIds())
+ france = region.europe.france
+ self.assertEquals('France', france.getTitle())
+ self.assertEquals('A Country', france.getDescription())
+ self.assertEquals('FR', france.getCodification())
+ self.assertEquals(1, france.getIntIndex())
+
+ def test_CategoryTool_importCategoryFile_DuplicateIds(self):
+ # tests CategoryTool_importCategoryFile when a document contain same
+ # categories ID at different level (a good candidate for an acquisition
+ # bug)
+ self.portal.portal_categories.CategoryTool_importCategoryFile(
+ import_file=makeFileUpload('import_region_category_duplicate_ids.sxc'))
+ get_transaction().commit()
+ self.tic()
+ region = self.portal.portal_categories.region
+ self.assertEqual(1, len(region))
+ self.assertEquals(['europe'], list(region.objectIds()))
+ self.assertEquals(['france'], list(region.europe.objectIds()))
+ self.assertEquals(['europe'], list(region.europe.france.objectIds()))
+ self.assertEquals(['france'], list(region.europe.france.europe.objectIds()))
+ self.assertEquals([], list(region.europe.france.europe.france.objectIds()))
# simple OOoParser tests
def test_getSpreadSheetMapping(self):
Added: erp5/trunk/products/ERP5OOo/tests/test_document/import_region_category_duplicate_ids.sxc
URL: http://svn.erp5.org/erp5/trunk/products/ERP5OOo/tests/test_document/import_region_category_duplicate_ids.sxc?rev=20801&view=auto
==============================================================================
Binary file - no diff available.
Propchange: erp5/trunk/products/ERP5OOo/tests/test_document/import_region_category_duplicate_ids.sxc
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: erp5/trunk/products/ERP5OOo/tests/test_document/import_region_category_path_stars.sxc
URL: http://svn.erp5.org/erp5/trunk/products/ERP5OOo/tests/test_document/import_region_category_path_stars.sxc?rev=20801&view=auto
==============================================================================
Binary file - no diff available.
Propchange: erp5/trunk/products/ERP5OOo/tests/test_document/import_region_category_path_stars.sxc
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
More information about the Erp5-report
mailing list