test_update.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:ckanext-powerview 作者: OCHA-DAP 项目源码 文件源码
def test_powerview_update_resources_unchanged(self):
        '''Updating a powerview containing resources, leaves them unchanged.'''

        sysadmin = Sysadmin()
        r1 = Resource()
        r2 = Resource()
        r3 = Resource()
        resource_id_list = [r1['id'], r2['id'], r3['id']]

        # powerview with resources
        powerview_dict = factories.PowerView(resources=resource_id_list)
        # Update dict with new title
        powerview_dict['title'] = "New Title"

        powerview_dict_update = toolkit.get_action('powerview_update')(
            context={'user': sysadmin['name']},
            data_dict=powerview_dict
        )

        nosetools.assert_equal(set(resource_id_list),
                               set(powerview_dict_update['resources']))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号