Commit 440c803a authored by Nicolas Dumazet's avatar Nicolas Dumazet

a propertysheet can be defined with a string


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@41776 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a21f416e
...@@ -116,6 +116,7 @@ class TestClassTool(ERP5TypeTestCase): ...@@ -116,6 +116,7 @@ class TestClassTool(ERP5TypeTestCase):
def test_DocumentationHelperExpressionCategory(self): def test_DocumentationHelperExpressionCategory(self):
# This tests checks that Documentation Helper works with propertysheets # This tests checks that Documentation Helper works with propertysheets
# that define their categories using expressions. # that define their categories using expressions.
from Products.ERP5Type import PropertySheet
from Products.ERP5Type.Document.Movement import Movement from Products.ERP5Type.Document.Movement import Movement
from Products.ERP5Type.Document.Delivery import Delivery from Products.ERP5Type.Document.Delivery import Delivery
from Products.CMFCore.Expression import Expression from Products.CMFCore.Expression import Expression
...@@ -125,6 +126,8 @@ class TestClassTool(ERP5TypeTestCase): ...@@ -125,6 +126,8 @@ class TestClassTool(ERP5TypeTestCase):
# by an expression. # by an expression.
found_one = 0 found_one = 0
for ps in movement.property_sheets: for ps in movement.property_sheets:
if isinstance(ps, basestring):
ps = getattr(PropertySheet, ps)
for category in getattr(ps, '_categories', []): for category in getattr(ps, '_categories', []):
if isinstance(category, Expression): if isinstance(category, Expression):
found_one = 1 found_one = 1
......
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