Skip to content

Commit

Permalink
[#2845] Don't import setup_testing_defaults directly
Browse files Browse the repository at this point in the history
Otherwise nose thinks it's a test for some reason and runs it. Silly
nose
  • Loading branch information
amercader committed Mar 11, 2016
1 parent 6e05650 commit e30d23e
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions ckan/tests/config/test_middleware.py
@@ -1,5 +1,5 @@
import mock
from wsgiref.util import setup_testing_defaults
import wsgiref
from nose.tools import assert_equals, assert_not_equals, eq_
from routes import url_for

Expand Down Expand Up @@ -67,7 +67,7 @@ def test_ask_around_is_called_with_args(self):

environ = {}
start_response = mock.MagicMock()
setup_testing_defaults(environ)
wsgiref.util.setup_testing_defaults(environ)

with mock.patch.object(AskAppDispatcherMiddleware, 'ask_around') as \
mock_ask_around:
Expand All @@ -87,7 +87,7 @@ def test_ask_around_flask_core_route_get(self):
'PATH_INFO': '/hello',
'REQUEST_METHOD': 'GET',
}
setup_testing_defaults(environ)
wsgiref.util.setup_testing_defaults(environ)

answers = app.ask_around('can_handle_request', environ)

Expand All @@ -110,7 +110,7 @@ def test_ask_around_flask_core_route_post(self):
'PATH_INFO': '/hello',
'REQUEST_METHOD': 'POST',
}
setup_testing_defaults(environ)
wsgiref.util.setup_testing_defaults(environ)

answers = app.ask_around('can_handle_request', environ)

Expand All @@ -133,7 +133,7 @@ def test_ask_around_pylons_core_route_get(self):
'PATH_INFO': '/dataset',
'REQUEST_METHOD': 'GET',
}
setup_testing_defaults(environ)
wsgiref.util.setup_testing_defaults(environ)

answers = app.ask_around('can_handle_request', environ)

Expand All @@ -153,7 +153,7 @@ def test_ask_around_pylons_core_route_post(self):
'PATH_INFO': '/dataset/new',
'REQUEST_METHOD': 'POST',
}
setup_testing_defaults(environ)
wsgiref.util.setup_testing_defaults(environ)

answers = app.ask_around('can_handle_request', environ)

Expand All @@ -176,7 +176,7 @@ def test_ask_around_pylons_extension_route_get_before_map(self):
'PATH_INFO': '/from_pylons_extension_before_map',
'REQUEST_METHOD': 'GET',
}
setup_testing_defaults(environ)
wsgiref.util.setup_testing_defaults(environ)

answers = app.ask_around('can_handle_request', environ)

Expand All @@ -201,7 +201,7 @@ def test_ask_around_pylons_extension_route_post(self):
'PATH_INFO': '/from_pylons_extension_before_map_post_only',
'REQUEST_METHOD': 'POST',
}
setup_testing_defaults(environ)
wsgiref.util.setup_testing_defaults(environ)

answers = app.ask_around('can_handle_request', environ)

Expand All @@ -226,7 +226,7 @@ def test_ask_around_pylons_extension_route_post_using_get(self):
'PATH_INFO': '/from_pylons_extension_before_map_post_only',
'REQUEST_METHOD': 'GET',
}
setup_testing_defaults(environ)
wsgiref.util.setup_testing_defaults(environ)

answers = app.ask_around('can_handle_request', environ)

Expand All @@ -253,7 +253,7 @@ def test_ask_around_pylons_extension_route_get_after_map(self):
'PATH_INFO': '/from_pylons_extension_after_map',
'REQUEST_METHOD': 'GET',
}
setup_testing_defaults(environ)
wsgiref.util.setup_testing_defaults(environ)

answers = app.ask_around('can_handle_request', environ)

Expand All @@ -278,7 +278,7 @@ def test_ask_around_flask_core_and_pylons_extension_route(self):
'PATH_INFO': '/pylons_and_flask',
'REQUEST_METHOD': 'GET',
}
setup_testing_defaults(environ)
wsgiref.util.setup_testing_defaults(environ)

answers = app.ask_around('can_handle_request', environ)
answers = sorted(answers, key=lambda a: a[1])
Expand Down

0 comments on commit e30d23e

Please sign in to comment.