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
Exemple #2
0
    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