[Erp5-report] r43211 nicolas.dumazet - /erp5/trunk/products/ERP5Type/tests/
nobody at svn.erp5.org
nobody at svn.erp5.org
Wed Feb 9 07:48:46 CET 2011
Author: nicolas.dumazet
Date: Wed Feb 9 07:48:46 2011
New Revision: 43211
URL: http://svn.erp5.org?rev=43211&view=rev
Log:
extend again foolproofness tests with a CategoryExpression wrongly configured
and returning wrongly a list containing a None value
Modified:
erp5/trunk/products/ERP5Type/tests/testDynamicClassGeneration.py
Modified: erp5/trunk/products/ERP5Type/tests/testDynamicClassGeneration.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/tests/testDynamicClassGeneration.py?rev=43211&r1=43210&r2=43211&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/tests/testDynamicClassGeneration.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/tests/testDynamicClassGeneration.py [utf8] Wed Feb 9 07:48:46 2011
@@ -1034,7 +1034,7 @@ class TestZodbPropertySheet(ERP5TypeTest
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(ERP5TypeTest
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):
More information about the Erp5-report
mailing list