diff --git a/ckanext/datapusher/tests/test.py b/ckanext/datapusher/tests/test.py index e951ec8c914..65150b1f7dc 100644 --- a/ckanext/datapusher/tests/test.py +++ b/ckanext/datapusher/tests/test.py @@ -47,11 +47,21 @@ def setup_class(cls): set_url_type( model.Package.get('annakarenina').resources, cls.sysadmin_user) + # Httpretty crashes with Solr on Python 2.6, disable the automatic + # Solr indexing + if (sys.version_info[0] == 2 and sys.version_info[1] == 6 + and p.plugin_loaded('synchronous_search')): + p.unload('synchronous_search') + @classmethod def teardown_class(cls): rebuild_all_dbs(cls.Session) p.unload('datastore') p.unload('datapusher') + # Reenable Solr indexing + if (sys.version_info[0] == 2 and sys.version_info[1] == 6 + and not p.plugin_loaded('synchronous_search')): + p.load('synchronous_search') def test_create_ckan_resource_in_package(self): package = model.Package.get('annakarenina') diff --git a/ckanext/resourceproxy/tests/test_proxy.py b/ckanext/resourceproxy/tests/test_proxy.py index 89f839af595..b461dbc9eb0 100644 --- a/ckanext/resourceproxy/tests/test_proxy.py +++ b/ckanext/resourceproxy/tests/test_proxy.py @@ -1,3 +1,4 @@ +import sys import requests import unittest import json @@ -27,7 +28,8 @@ def set_resource_url(url): context = { 'model': model, 'session': model.Session, - 'user': model.User.get('testsysadmin').name + 'user': model.User.get('testsysadmin').name, + 'use_cache': False, } resource = p.toolkit.get_action('resource_show')( @@ -55,12 +57,23 @@ def setup_class(cls): wsgiapp = middleware.make_app(config['global_conf'], **config) cls.app = paste.fixture.TestApp(wsgiapp) create_test_data.CreateTestData.create() + # Httpretty crashes with Solr on Python 2.6, disable the automatic + # Solr indexing + if (sys.version_info[0] == 2 and sys.version_info[1] == 6 + and p.plugin_loaded('synchronous_search')): + p.unload('synchronous_search') + @classmethod def teardown_class(cls): config.clear() config.update(cls._original_config) model.repo.rebuild_db() + # Reenable Solr indexing + if (sys.version_info[0] == 2 and sys.version_info[1] == 6 + and not p.plugin_loaded('synchronous_search')): + p.load('synchronous_search') + def setUp(self): self.url = 'http://www.ckan.org/static/example.json'