[Erp5-report] r22944 - in /erp5/trunk/products/ERP5OOo/tests: ./ test_document/
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Aug 7 19:19:43 CEST 2008
Author: jerome
Date: Thu Aug 7 19:19:42 2008
New Revision: 22944
URL: http://svn.erp5.org?rev=22944&view=rev
Log:
test CategoryTool_importCategoryFile when the spreadsheet has no id column, the
id is guessed from title column. Test this with non ascii characters
Added:
erp5/trunk/products/ERP5OOo/tests/test_document/import_region_category_path_stars_non_ascii.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=22944&r1=22943&r2=22944&view=diff
==============================================================================
--- erp5/trunk/products/ERP5OOo/tests/testOOoImport.py (original)
+++ erp5/trunk/products/ERP5OOo/tests/testOOoImport.py Thu Aug 7 19:19:42 2008
@@ -1,5 +1,5 @@
##############################################################################
-#
+# -*- coding: utf8 -*-
# Copyright (c) 2005 Nexedi SARL and Contributors. All Rights Reserved.
# Nicolas Delaby <nicolas at nexedi.com>
#
@@ -37,11 +37,6 @@
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5OOo.OOoUtils import OOoParser
-
-def shout(msg):
- msg = str(msg)
- ZopeTestCase._print('\n ' + msg)
- LOG('Testing... ', 0, msg)
def unpackData(data):
"""
@@ -274,6 +269,25 @@
self.assertEquals('FR', france.getCodification())
self.assertEquals(1, france.getIntIndex())
+ def test_CategoryTool_importCategoryFile_PathStars_noID(self):
+ # tests CategoryTool_importCategoryFile with * in the paths columns, and no
+ # ID column, and non ascii titles
+ self.portal.portal_categories.CategoryTool_importCategoryFile(
+ import_file=makeFileUpload(
+ 'import_region_category_path_stars_non_ascii.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('Frà nce', 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
Added: erp5/trunk/products/ERP5OOo/tests/test_document/import_region_category_path_stars_non_ascii.sxc
URL: http://svn.erp5.org/erp5/trunk/products/ERP5OOo/tests/test_document/import_region_category_path_stars_non_ascii.sxc?rev=22944&view=auto
==============================================================================
Binary file - no diff available.
Propchange: erp5/trunk/products/ERP5OOo/tests/test_document/import_region_category_path_stars_non_ascii.sxc
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
More information about the Erp5-report
mailing list