From c141cf44fa0a57f34a584c351240269092da26f4 Mon Sep 17 00:00:00 2001 From: Stefan Oderbolz Date: Mon, 11 Jan 2016 22:13:25 +0100 Subject: [PATCH 1/2] Swap import statements to make sure `run_test` works on CKAN 2.3 --- ckanext/harvest/tests/factories.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ckanext/harvest/tests/factories.py b/ckanext/harvest/tests/factories.py index fc70f09..aa5ff84 100644 --- a/ckanext/harvest/tests/factories.py +++ b/ckanext/harvest/tests/factories.py @@ -1,9 +1,9 @@ import factory import ckanext.harvest.model as harvest_model try: - from ckan.tests.factories import _get_action_user_name -except ImportError: from ckan.new_tests.factories import _get_action_user_name +except ImportError: + from ckan.tests.factories import _get_action_user_name from ckan.plugins import toolkit From e0c33165313d661c701014c024fdadaeec86c2f7 Mon Sep 17 00:00:00 2001 From: Stefan Oderbolz Date: Mon, 11 Jan 2016 22:35:11 +0100 Subject: [PATCH 2/2] Add legacy import for CreateTestData --- ckanext/harvest/tests/test_auth.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ckanext/harvest/tests/test_auth.py b/ckanext/harvest/tests/test_auth.py index 13ca6f1..68ae301 100644 --- a/ckanext/harvest/tests/test_auth.py +++ b/ckanext/harvest/tests/test_auth.py @@ -7,9 +7,11 @@ from ckan.model import Package, Session from ckan.lib.helpers import url_for,json from ckan.lib.base import config - -from ckan.tests import CreateTestData #TODO: remove references to old tests +try: + from ckan.tests import CreateTestData +except ImportError: + from ckan.tests.legacy import CreateTestData try: from ckan.tests.functional.base import FunctionalTestCase except ImportError: