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