def test_importer_switch_indexing(self): importer = ExternalEventImporter(self.directory) event = self.create_event() event.submit() event.publish() reindex_directory(self.directory) self.assertEquals(len(self.catalog.ix_published.index), 1) importer.disable_indexing() event = self.create_event() event.submit() event.publish() reindex_directory(self.directory) self.assertEquals(len(self.catalog.ix_published.index), 1) importer.enable_indexing() reindex_directory(self.directory) self.assertEquals(len(self.catalog.ix_published.index), 2)