Commit cfa916d1 authored by Nicolas Delaby's avatar Nicolas Delaby

Add test for limit argument

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12579 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d958c649
...@@ -1268,7 +1268,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -1268,7 +1268,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
[x.getObject() for x in self.getCatalogTool()( [x.getObject() for x in self.getCatalogTool()(
parent_title=person_module.getTitle())]) parent_title=person_module.getTitle())])
def test_46_QueryAndComplexQuery(self,quiet=quiet, run=1): def test_45_QueryAndComplexQuery(self,quiet=quiet, run=1):
""" """
""" """
if not run: return if not run: return
...@@ -1314,4 +1314,18 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -1314,4 +1314,18 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
[x.path for x in self.getCatalogTool()( [x.path for x in self.getCatalogTool()(
portal_type='Organisation',**catalog_kw)]) portal_type='Organisation',**catalog_kw)])
def test_46_TestLimit(self,quiet=quiet, run=1):
"""
"""
if not run: return
if not quiet:
message = 'Test Limit'
ZopeTestCase._print('\n%s ' % message)
LOG('Testing... ',0,message)
#Create 1002 Organisations
for i in xrange(1002):
self._makeOrganisation(title='abc%s' % (i),description='abc')
self.assertEqual(1000,len(self.getCatalogTool()(portal_type='Organisation')))
self.assertEqual(1002,len(self.getCatalogTool()(portal_type='Organisation',limit=None)))
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