Commit df343c60 authored by David Read's avatar David Read
Browse files

Merge commit '1f347c1b' into fix-travis

parents 99de5995 1f347c1b
......@@ -439,8 +439,8 @@ def archive_resource(context, resource, log, result=None, url_timeout=30):
# calculate the cache_url
if not context.get('cache_url_root'):
log.warning('Not saved cache_url because no value for cache_url_root '
'in config')
log.warning('Not saved cache_url because no value for '
'ckanext-archiver.cache_url_root in config')
raise ArchiveError('No value for ckanext-archiver.cache_url_root in config')
cache_url = urlparse.urljoin(context['cache_url_root'],
'%s/%s' % (relative_archive_path, file_name))
......@@ -14,6 +14,12 @@ from ckan import model
from ckan import plugins
from ckan.tests import BaseCase
from ckan.logic import get_action
from ckan.tests.helpers import reset_db
from ckan.tests import factories as ckan_factories
except ImportError:
from ckan.new_tests.helpers import reset_db
from ckan.new_tests import factories as ckan_factories
from ckanext.archiver import model as archiver_model
from ckanext.archiver.model import Archival
......@@ -62,6 +68,7 @@ class TestLinkChecker(BaseCase):
def setup_class(cls):
cls._saved_plugins_config = config.get('ckan.plugins', '')
config['ckan.plugins'] = 'archiver'
......@@ -158,6 +165,7 @@ class TestArchiver(BaseCase):
def setup_class(cls):
cls.temp_dir = tempfile.mkdtemp()
......@@ -176,11 +184,10 @@ class TestArchiver(BaseCase):
def _test_package(self, url, format=None):
context = {'model': model, 'ignore_auth': True, 'session': model.Session, 'user': 'test'}
pkg = {'name': 'testpkg', 'resources': [
pkg = {'resources': [
{'url': url, 'format': format or 'TXT', 'description': 'Test'}
pkg = get_action('package_create')(context, pkg)
pkg = ckan_factories.Dataset(**pkg)
return pkg
def _test_resource(self, url, format=None):
......@@ -375,6 +382,7 @@ class TestDownload(BaseCase):
def setup_class(cls):
cls.fake_context = {
'site_url': config.get('ckan.site_url_internally') or config['ckan.site_url'],
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment