Exemplo n.º 1
0
    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']
Exemplo n.º 3
0
    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(),
        }
Exemplo n.º 4
0
    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(),
        }
Exemplo n.º 5
0
# 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,