def setup_class(self): print ("") if not search.is_available(): raise Exception('Solr not reachable') self.solr_client = search.make_connection() self.fq = " +site_id:\"%s\" +md_author_names:[* TO *] +md_content_models:[* TO *] +md_organization_names:[* TO *] +res_format:[* TO *] " % config['ckan.site_id']
def setup_class(self): print("") if not search.is_available(): raise Exception('Solr not reachable') self.solr_client = search.make_connection() self.fq = " +site_id:\"%s\" +md_author_names:[* TO *] +md_content_models:[* TO *] +md_organization_names:[* TO *] +res_format:[* TO *] " % config[ 'ckan.site_id']
def setup_class(cls): if not search.is_available(): raise nose.SkipTest('Solr not reachable') cls.solr_client = search.make_connection() cls.fq = " +site_id:\"%s\" " % config['ckan.site_id'] cls.package_index = search.PackageSearchIndex() cls.base_package_dict = { 'id': 'test-index', 'name': 'monkey', 'title': 'Monkey', 'state': 'active', 'private': False, 'type': 'dataset', 'owner_org': None, 'metadata_created': datetime.datetime.now().isoformat(), 'metadata_modified': datetime.datetime.now().isoformat(), }
def setup_class(cls): if not search.is_available(): raise nose.SkipTest('Solr not reachable') cls.solr_client = search.make_connection() cls.fq = " +site_id:\"%s\" " % config['ckan.site_id'] cls.package_index = search.PackageSearchIndex() cls.base_package_dict = { 'id': 'test-index', 'name': 'monkey', 'title': 'Monkey', 'state': 'active', 'private': False, 'type': 'dataset', 'owner_org': None, 'metadata_created': datetime.datetime.now().isoformat(), 'metadata_modified': datetime.datetime.now().isoformat(), }
# encoding: utf-8 import datetime import hashlib import json import pytest import six from ckan.common import config import ckan.lib.search as search @pytest.mark.skipif(not search.is_available(), reason="Solr not reachable") @pytest.mark.usefixtures("clean_index") class TestSearchIndex(object): @classmethod def setup_class(cls): cls.solr_client = search.make_connection() cls.fq = ' +site_id:"%s" ' % config["ckan.site_id"] cls.package_index = search.PackageSearchIndex() cls.base_package_dict = { "id": "test-index", "name": "monkey", "title": "Monkey", "state": "active", "private": False, "type": "dataset", "owner_org": None,