test_schema.py 文件源码

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

项目:ckanext-powerview 作者: OCHA-DAP 项目源码 文件源码
def test_powerview_show_nonexisting_id(self):
        '''Calling powerview show with a non-existing id raises error.'''

        sysadmin = Sysadmin()

        factories.PowerView()

        with nosetools.assert_raises(ValidationError) as cm:
            toolkit.get_action('powerview_show')(
                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.")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号