Skip to content

Commit

Permalink
Fix legacy tests
Browse files Browse the repository at this point in the history
  • Loading branch information
smotornyuk committed Jul 26, 2019
1 parent 3fa3333 commit 845a7f0
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions ckan/tests/legacy/test_plugins.py
Expand Up @@ -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()
Expand Down Expand Up @@ -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, {})
Expand Down

0 comments on commit 845a7f0

Please sign in to comment.