Commit 9a453e85 authored by Nicolas Dumazet's avatar Nicolas Dumazet

extend again foolproofness tests with a CategoryExpression wrongly configured

and returning wrongly a list containing a None value


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43211 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3ba11d28
......@@ -1034,7 +1034,7 @@ class TestZodbPropertySheet(ERP5TypeTestCase):
except:
self.fail("Creating an empty Category Property raises an error")
arrow.newContent(portal_type="Dynamic Category Property")
dynamic_category = arrow.newContent(portal_type="Dynamic Category Property")
transaction.commit()
try:
person.newContent(portal_type="Career")
......@@ -1048,6 +1048,16 @@ class TestZodbPropertySheet(ERP5TypeTestCase):
except:
self.fail("Creating an empty Constraint raises an error")
# be really nasty, and test that code is still foolproof
# (this None value should never appear in an expression... unless
# the method has a mistake)
dynamic_category.setCategoryExpression('python: ["foo", None, "region"]')
transaction.commit()
try:
person.newContent(portal_type="Career")
except:
self.fail("Creating an invalid Category Expression raises an error")
from Products.CMFCore.Expression import Expression
class TestZodbImportFilesystemPropertySheet(ERP5TypeTestCase):
......
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