tests.py 文件源码

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

项目:mos-horizon 作者: Mirantis 项目源码 文件源码
def _test_new_button_disabled_when_quota_exceeded(
            self, expected_string, networks_quota=10,
            routers_quota=10, instances_quota=10):
        quota_data = self.quota_usages.first()
        quota_data['networks']['available'] = networks_quota
        quota_data['routers']['available'] = routers_quota
        quota_data['instances']['available'] = instances_quota

        quotas.tenant_quota_usages(
            IsA(http.HttpRequest)) \
            .MultipleTimes().AndReturn(quota_data)

        self.mox.ReplayAll()

        res = self.client.get(INDEX_URL)
        self.assertTemplateUsed(res, 'project/network_topology/index.html')

        self.assertContains(res, expected_string, html=True,
                            msg_prefix="The create button is not disabled")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号