def setUp(self): from Products.PluginIndexes.DateRangeIndex.DateRangeIndex \ import DateRangeIndex NodeAdapterTestCase.setUp(self) self._obj = DateRangeIndex('foo_daterange') self._XML = _DATERANGE_XML
def setUp(self): from Products.PluginIndexes.DateRangeIndex.DateRangeIndex \ import DateRangeIndex PlacelessSetup.setUp(self) zcml.load_config('meta.zcml', Products.Five) zcml.load_config('configure.zcml', Products.GenericSetup.PluginIndexes) self._obj = DateRangeIndex('foo_daterange') self._XML = _DATERANGE_XML
def setUp(self): import Products.GenericSetup.PluginIndexes from Products.PluginIndexes.DateRangeIndex.DateRangeIndex \ import DateRangeIndex NodeAdapterTestCase.setUp(self) zcml.load_config('configure.zcml', Products.GenericSetup.PluginIndexes) self._obj = DateRangeIndex('foo_daterange') self._XML = _DATERANGE_XML
def _make_catalog(self): zcat = ZCatalog('catalog') zcat._catalog.addIndex('big', BooleanIndex('big')) zcat._catalog.addIndex('date', DateRangeIndex('date', 'start', 'end')) zcat._catalog.addIndex('num', FieldIndex('num')) zcat._catalog.addIndex('numbers', KeywordIndex('numbers')) zcat._catalog.addIndex('path', PathIndex('getPhysicalPath')) zcat._catalog.addIndex('uuid', UUIDIndex('num')) for i in range(9): obj = Dummy(i) zcat.catalog_object(obj, str(i)) return zcat
def test_DateRangeIndex(self): from xml.dom.minidom import parseString from Products.PluginIndexes.DateRangeIndex.DateRangeIndex \ import DateRangeIndex from Products.GenericSetup.testing import DummySetupEnviron from Products.GenericSetup.PluginIndexes.exportimport \ import DateRangeIndexNodeAdapter environ = DummySetupEnviron() def _no_clear(*a): raise AssertionError("Don't clear me!") index = DateRangeIndex('foo_daterange') index._since_field = 'bar' index._until_field = 'baz' index.clear = _no_clear adapted = DateRangeIndexNodeAdapter(index, environ) adapted.node = parseString(_DATERANGE_XML).documentElement # no raise
def _make_catalog(self): from Products.PluginIndexes.BooleanIndex.BooleanIndex import \ BooleanIndex from Products.PluginIndexes.DateRangeIndex.DateRangeIndex import \ DateRangeIndex from Products.PluginIndexes.FieldIndex.FieldIndex import FieldIndex from Products.PluginIndexes.KeywordIndex.KeywordIndex import \ KeywordIndex from Products.PluginIndexes.PathIndex.PathIndex import PathIndex from Products.PluginIndexes.UUIDIndex.UUIDIndex import UUIDIndex from Products.ZCatalog.ZCatalog import ZCatalog zcat = ZCatalog('catalog') zcat._catalog.addIndex('big', BooleanIndex('big')) zcat._catalog.addIndex('date', DateRangeIndex('date', 'start', 'end')) zcat._catalog.addIndex('num', FieldIndex('num')) zcat._catalog.addIndex('numbers', KeywordIndex('numbers')) zcat._catalog.addIndex('path', PathIndex('getPhysicalPath')) zcat._catalog.addIndex('uuid', UUIDIndex('num')) for i in range(9): obj = dummy(i) zcat.catalog_object(obj, str(i)) return zcat
def setUp(self): from Products.PluginIndexes.DateRangeIndex.DateRangeIndex import \ DateRangeIndex self._obj = DateRangeIndex('foo_daterange') self._XML = _DATERANGE_XML