From 05d6287b93bbdb1cbf353a21206e2c42080b5edd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Nowak?= <luke@nexedi.com> Date: Thu, 18 Feb 2010 10:40:35 +0000 Subject: [PATCH] - check for expiration and deletion of existing category git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32752 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5OOo/tests/testOOoImport.py | 45 ++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/product/ERP5OOo/tests/testOOoImport.py b/product/ERP5OOo/tests/testOOoImport.py index 147f061990..17c2ead0df 100644 --- a/product/ERP5OOo/tests/testOOoImport.py +++ b/product/ERP5OOo/tests/testOOoImport.py @@ -761,6 +761,51 @@ class TestOOoImport(ERP5TypeTestCase): self.assertEquals('FR', france.getCodification()) self.assertEquals(1, france.getIntIndex()) + def test_CategoryTool_importCategoryFileDeletionSupport(self): + # tests simple use of CategoryTool_importCategoryFile script + region = self.portal.portal_categories.region + dummy_region = region.newContent(id='dummy_region') + transaction.commit() + self.tic() + self.portal.portal_categories.CategoryTool_importCategoryFile( + import_file=makeFileUpload('import_region_category.sxc'), + existing_category_list='delete') + transaction.commit() + self.tic() + 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.assertTrue(france.hasProperty('title')) + self.assertEquals('A Country', france.getDescription()) + self.assertEquals('FR', france.getCodification()) + self.assertEquals(1, france.getIntIndex()) + + def test_CategoryTool_importCategoryFileExpirationSupport(self): + # tests simple use of CategoryTool_importCategoryFile script + region = self.portal.portal_categories.region + dummy_region = region.newContent(id='dummy_region') + transaction.commit() + self.tic() + self.portal.portal_categories.CategoryTool_importCategoryFile( + import_file=makeFileUpload('import_region_category.sxc'), + existing_category_list='expire') + transaction.commit() + self.tic() + self.assertEqual(3, len(region)) + self.assertTrue('dummy_region' in region.objectIds()) + 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.assertTrue(france.hasProperty('title')) + self.assertEquals('A Country', france.getDescription()) + self.assertEquals('FR', france.getCodification()) + self.assertEquals(1, france.getIntIndex()) + def test_CategoryTool_importCategoryFileXLS(self): # tests that CategoryTool_importCategoryFile supports .xls files self.portal.portal_categories.CategoryTool_importCategoryFile( -- 2.30.9