Commit 9d384003 authored by Jérome Perrin's avatar Jérome Perrin

test CategoryTool_importCategoryFile when the spreadsheet has no id column, the

id is guessed from title column. Test this with non ascii characters


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@22944 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a6cd0742
##############################################################################
#
# -*- coding: utf8 -*-
# Copyright (c) 2005 Nexedi SARL and Contributors. All Rights Reserved.
# Nicolas Delaby <nicolas@nexedi.com>
#
......@@ -38,11 +38,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):
"""
Unpack Pdata into string
......@@ -274,6 +269,25 @@ class TestOOoImport(ERP5TypeTestCase):
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
......
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