tests.py 文件源码

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

项目:mos-horizon 作者: Mirantis 项目源码 文件源码
def test_view_container(self):
        for container in self.containers.list():
            self.mox.ResetAll()  # mandatory in a for loop
            api.swift.swift_get_container(IsA(http.HttpRequest),
                                          container.name,
                                          with_data=False) \
                .AndReturn(container)
            self.mox.ReplayAll()

            view_url = reverse('horizon:project:containers:container_detail',
                               args=[container.name])
            res = self.client.get(view_url)

            self.assertTemplateUsed(res,
                                    'project/containers/container_detail.html')
            self.assertContains(res, container.name, 1, 200)
            self.assertNotContains(res, INVALID_CONTAINER_NAME_1)
            self.assertNotContains(res, INVALID_CONTAINER_NAME_2)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号