tests.py 文件源码

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

项目:django-icekit 作者: ic-labs 项目源码 文件源码
def test_model(self):
        req = HttpRequest()
        self.article.publish()
        self.article_2.publish()
        # test the listing contains the published article
        self.assertTrue(self.article.get_published() in self.listing.get_items_to_list(req))
        # ...not the draft one
        self.assertTrue(self.article not in self.listing.get_items_to_list(req))
        # ...not an article that isn't associated with the listing
        self.assertTrue(self.article_2 not in self.listing.get_items_to_list(req))
        self.assertTrue(self.article_2.get_published() not in self.listing.get_items_to_list(req))
        self.article.unpublish()
        self.article_2.unpublish()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号