From 845a7f07f8fe9a88369e36df83916da8552a26f6 Mon Sep 17 00:00:00 2001 From: Sergey Motornyuk Date: Fri, 26 Jul 2019 18:01:17 +0300 Subject: [PATCH] Fix legacy tests --- ckan/tests/legacy/test_plugins.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ckan/tests/legacy/test_plugins.py b/ckan/tests/legacy/test_plugins.py index 3af1524ad4b..7ec6bd59e71 100644 --- a/ckan/tests/legacy/test_plugins.py +++ b/ckan/tests/legacy/test_plugins.py @@ -101,7 +101,7 @@ def test_plugins_load(self): # synchronous_search automatically gets loaded current_plugins = set([plugins.get_plugin(p) for p in ['mapper_plugin', 'routes_plugin', 'synchronous_search'] + find_system_plugins()]) - assert PluginGlobals.env().services == current_plugins + assert set(plugins.core._PLUGINS_SERVICE.values()) == current_plugins # cleanup config['ckan.plugins'] = config_plugins plugins.load_all() @@ -175,10 +175,15 @@ def test_mapper_plugin_fired_on_delete(self): def test_routes_plugin_fired(self): with plugins.use_plugin('routes_plugin'): - routes_plugin = PluginGlobals.env_registry['pca'].plugin_registry['RoutesPlugin'].__instance__ - assert routes_plugin.calls_made == ['before_map', 'after_map'], \ - routes_plugin.calls_made + pca = PluginGlobals.env['pca'] + routes_plugin_idx = pca.singleton_services[ + pca.plugin_registry['RoutesPlugin'] + ] + + routes_plugin = PluginGlobals.plugin_instances[routes_plugin_idx] + assert routes_plugin.calls_made == ['before_map', 'after_map'], \ + routes_plugin.calls_made def test_action_plugin_override(self): status_show_original = logic.get_action('status_show')(None, {})