Skip to content

Commit

Permalink
[#4430] test fixes
Browse files Browse the repository at this point in the history
based on e1a3d05 by @tino097
  • Loading branch information
wardi committed Aug 31, 2018
1 parent a9b797b commit 19b9a04
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 17 deletions.
6 changes: 5 additions & 1 deletion ckan/config/environment.py
Expand Up @@ -45,7 +45,10 @@ def load_environment(global_conf, app_conf):
# Required by the deliverance plugin and iATI
from pylons.wsgiapp import PylonsApp
import pkg_resources
find_controller_generic = PylonsApp.find_controller
find_controller_generic = getattr(
PylonsApp.find_controller,
'_old_find_controller',
PylonsApp.find_controller)

# This is from pylons 1.0 source, will monkey-patch into 0.9.7
def find_controller(self, controller):
Expand All @@ -65,6 +68,7 @@ def find_controller(self, controller):
self.controller_classes[controller] = mycontroller
return mycontroller
return find_controller_generic(self, controller)
find_controller._old_find_controller = find_controller_generic
PylonsApp.find_controller = find_controller

os.environ['CKAN_CONFIG'] = global_conf['__file__']
Expand Down
17 changes: 1 addition & 16 deletions ckanext/imageview/tests/test_view.py
Expand Up @@ -9,22 +9,7 @@


class TestImageView(helpers.FunctionalTestBase):

@classmethod
def setup_class(cls):

super(TestImageView, cls).setup_class()

if not p.plugin_loaded('image_view'):
p.load('image_view')

@classmethod
def teardown_class(cls):
p.unload('image_view')

super(TestImageView, cls).teardown_class()

helpers.reset_db()
_load_plugins = ['image_view']

@helpers.change_config('ckan.views.default_views', '')
def test_view_shown_on_resource_page_with_image_url(self):
Expand Down

0 comments on commit 19b9a04

Please sign in to comment.