def test_powerview_resource_list_nonexisting_id(self):
'''Calling powerview resource list with a non-existing id raises
error.'''
sysadmin = Sysadmin()
factories.PowerView()
with nosetools.assert_raises(ValidationError) as cm:
toolkit.get_action('powerview_resource_list')(
context={'user': sysadmin['name']},
data_dict={'id': 'non-existin-id'}
)
error_dict = cm.exception.error_dict['id']
nosetools.assert_true("Not found: PowerView"
in error_dict,
"Expected string not in exception message.")
评论列表
文章目录