diff --git a/ckan/new_tests/helpers.py b/ckan/new_tests/helpers.py index e95e6cdddc6..709b0607fee 100644 --- a/ckan/new_tests/helpers.py +++ b/ckan/new_tests/helpers.py @@ -21,9 +21,6 @@ import ckan.logic as logic -NotAuthorized = logic.NotAuthorized - - def reset_db(): '''Reset CKAN's database. diff --git a/ckan/new_tests/logic/auth/test_update.py b/ckan/new_tests/logic/auth/test_update.py index a603c334dcd..a61b35828e9 100644 --- a/ckan/new_tests/logic/auth/test_update.py +++ b/ckan/new_tests/logic/auth/test_update.py @@ -6,6 +6,7 @@ import ckan.new_tests.helpers as helpers import ckan.new_tests.factories as factories +import ckan.logic as logic class TestUpdate(object): @@ -34,7 +35,7 @@ def test_user_update_visitor_cannot_update_user(self): 'name': 'updated_user_name', } - with nose.tools.assert_raises(helpers.NotAuthorized) as cm: + with nose.tools.assert_raises(logic.NotAuthorized) as cm: helpers.call_auth('user_update', context=context, **params) assert cm.exception.extra_msg == ('User 127.0.0.1 not authorized to ' @@ -72,7 +73,7 @@ def test_user_update_user_cannot_update_another_user(self): # 3. Make assertions about the return value and/or side-effects. - with nose.tools.assert_raises(helpers.NotAuthorized) as cm: + with nose.tools.assert_raises(logic.NotAuthorized) as cm: helpers.call_auth('user_update', context=context, **params) assert cm.exception.extra_msg == ('User bob not authorized to edit ' @@ -131,7 +132,7 @@ def test_user_update_with_no_user_in_context(self): 'id': mock_user.id, 'name': 'updated_user_name', } - with nose.tools.assert_raises(helpers.NotAuthorized) as cm: + with nose.tools.assert_raises(logic.NotAuthorized) as cm: helpers.call_auth('user_update', context=context, **params) assert cm.exception.extra_msg == 'Have to be logged in to edit user'