Commit e4ba5128 authored by Vincent Pelletier's avatar Vincent Pelletier

Add a test to check that the "%" wildcard matches unset values.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20901 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 92bf16ac
...@@ -2630,6 +2630,22 @@ VALUES ...@@ -2630,6 +2630,22 @@ VALUES
compareSet('foo ', []) compareSet('foo ', [])
compareSet(' foo ', []) compareSet(' foo ', [])
def test_WildcardMatchesUnsetValue(self, quiet=quiet, run=run_all_test):
"""
Check that the "%" wildcard matches unset values.
"""
if not run:
return
portal_type = 'Organisation'
folder = self.getOrganisationModule()
first_doc = folder.newContent(portal_type=portal_type, reference="doc 1")
second_doc = folder.newContent(portal_type=portal_type, reference="doc 2", description="test")
get_transaction().commit()
self.tic()
result = folder.portal_catalog(portal_type=portal_type, reference='doc %', description='%')
self.assertEqual(len(result), 2)
def test_suite(): def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestERP5Catalog)) suite.addTest(unittest.makeSuite(TestERP5Catalog))
......
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