Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Boxiang Sun
erp5
Commits
385c4c30
Commit
385c4c30
authored
May 07, 2018
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Category: use new preference about whitespace to indent category item list
parent
a5c57eae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
product/CMFCategory/Category.py
product/CMFCategory/Category.py
+4
-1
product/CMFCategory/tests/testCMFCategory.py
product/CMFCategory/tests/testCMFCategory.py
+10
-0
No files found.
product/CMFCategory/Category.py
View file @
385c4c30
...
...
@@ -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
,
''
]:
...
...
product/CMFCategory/tests/testCMFCategory.py
View file @
385c4c30
...
...
@@ -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'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment