From 01826e72c88225db96863f6f9112c619cb4001f6 Mon Sep 17 00:00:00 2001 From: David Read Date: Thu, 15 Jan 2015 16:00:31 +0000 Subject: [PATCH] [#1753] Add backward compatibility for tests and warning. Tested against ckanext-harvest/spatial/archiver/qa. --- ckan/tests/__init__.py | 9 +++++++++ ckan/tests/functional/__init__.py | 10 ++++++++++ ckan/tests/functional/api/base.py | 11 +++++++++++ ckan/tests/functional/base.py | 9 +++++++++ ckan/tests_legacy/__init__.py | 4 ++++ 5 files changed, 43 insertions(+) create mode 100644 ckan/tests/__init__.py create mode 100644 ckan/tests/functional/__init__.py create mode 100644 ckan/tests/functional/api/base.py create mode 100644 ckan/tests/functional/base.py diff --git a/ckan/tests/__init__.py b/ckan/tests/__init__.py new file mode 100644 index 00000000000..45d63f0feee --- /dev/null +++ b/ckan/tests/__init__.py @@ -0,0 +1,9 @@ +import warnings + +warnings.warn( + "ckan.tests has been renamed to ckan.tests_legacy. " + "In the next release it is planned to remove ckan.tests, and possibly " + "rename ckan.new_tests to ckan.tests.", + FutureWarning) + +from ckan.tests_legacy import * diff --git a/ckan/tests/functional/__init__.py b/ckan/tests/functional/__init__.py new file mode 100644 index 00000000000..df5145ef0d4 --- /dev/null +++ b/ckan/tests/functional/__init__.py @@ -0,0 +1,10 @@ +import warnings + +warnings.warn( + "ckan.tests has been renamed to ckan.tests_legacy. " + "In the next release it is planned to remove ckan.tests, and possibly " + "rename ckan.new_tests to ckan.tests.", + FutureWarning) + +from ckan.tests_legacy.functional import * + diff --git a/ckan/tests/functional/api/base.py b/ckan/tests/functional/api/base.py new file mode 100644 index 00000000000..5b4b577de91 --- /dev/null +++ b/ckan/tests/functional/api/base.py @@ -0,0 +1,11 @@ +import warnings + +warnings.warn( + "ckan.tests has been renamed to ckan.tests_legacy. " + "In the next release it is planned to remove ckan.tests, and possibly " + "rename ckan.new_tests to ckan.tests.", + FutureWarning) + +from ckan.tests_legacy.functional.api.base import * + + diff --git a/ckan/tests/functional/base.py b/ckan/tests/functional/base.py new file mode 100644 index 00000000000..adab2af6b78 --- /dev/null +++ b/ckan/tests/functional/base.py @@ -0,0 +1,9 @@ +import warnings + +warnings.warn( + "ckan.tests has been renamed to ckan.tests_legacy. " + "In the next release it is planned to remove ckan.tests, and possibly " + "rename ckan.new_tests to ckan.tests.", + FutureWarning) + +from ckan.tests_legacy.functional.base import * diff --git a/ckan/tests_legacy/__init__.py b/ckan/tests_legacy/__init__.py index a5c711afb90..a0b9287c0f0 100644 --- a/ckan/tests_legacy/__init__.py +++ b/ckan/tests_legacy/__init__.py @@ -46,6 +46,10 @@ 'TestCase', 'SkipTest', 'CkanServerCase', + 'call_action_api', + 'BaseCase', + 'here_dir', + 'conf_dir', ] here_dir = os.path.dirname(os.path.abspath(__file__))