def test_powerview_show_with_resources(self):
'''Calling powerview show should return list of resource ids.'''
sysadmin = Sysadmin()
r1 = Resource()
r2 = Resource()
r3 = Resource()
powerview_dict_create = factories.PowerView(resources=[r1['id'],
r2['id'],
r3['id']])
powerview_dict_show = toolkit.get_action('powerview_show')(
context={'user': sysadmin['name']},
data_dict={'id': powerview_dict_create['id']}
)
nosetools.assert_equal(powerview_dict_create, powerview_dict_show)
resource_list = powerview_dict_show['resources']
nosetools.assert_equal(len(resource_list), 3)
nosetools.assert_true(r1['id'] in resource_list)
nosetools.assert_true(r2['id'] in resource_list)
nosetools.assert_true(r3['id'] in resource_list)
评论列表
文章目录