Commit 385c4c30 authored by Nicolas Wavrant's avatar Nicolas Wavrant

Category: use new preference about whitespace to indent category item list

parent a5c57eae
......@@ -217,7 +217,10 @@ class Category(Folder):
logical_title_list = []
if path_len >= 2:
logical_title_list.append(NBSP_UTF8 * 4 * (path_len - 1))
logical_title_list.append(
NBSP_UTF8 * \
self.portal_preferences.getPreferredWhitespaceNumberForChildItemIndentation(4) * \
(path_len - 1))
logical_title = getattr(self, item_method)()
if logical_title in [None, '']:
......
......@@ -30,6 +30,7 @@ from collections import deque
import unittest
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.CMFCategory.Category import NBSP_UTF8
from Testing.ZopeTestCase.PortalTestCase import PortalTestCase
from AccessControl.SecurityManagement import newSecurityManager
from AccessControl.SecurityManagement import noSecurityManager
......@@ -731,6 +732,15 @@ class TestCMFCategory(ERP5TypeTestCase):
strict_membership=1,
portal_type='Organisation')], [organisation])
def test_20_CategoryChildIndentedTitle(self):
base_cat = self.getCategoryTool().newContent(portal_type='Base Category')
cat = base_cat.newContent(portal_type='Category',
id='the_id', title='The Title')
sub_cat = cat.newContent(portal_type='Category',
id='the_sub_id', title='The Sub Title')
whitespace_number = self.portal.portal_preferences.getPreferredWhitespaceNumberForChildItemIndentation()
self.assertEqual(NBSP_UTF8 * whitespace_number + 'The Sub Title', sub_cat.getIndentedTitle())
def test_20_CategoryChildTitleAndIdItemList(self):
"""Tests getCategoryChildTitleAndIdItemList."""
base_cat = self.getCategoryTool().newContent(portal_type='Base Category')
......
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