test_views.py 文件源码

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

项目:brief_history 作者: shispt 项目源码 文件源码
def test_home_has_pages(self):
        page1 = Page(title='??1', url='https://test1.org',
                     birth_date='2017-06-30', has_birth_date=True)
        page1.save()
        page2 = Page(title='??2', url='https://test2.org',
                     birth_date='2017-07-01', has_birth_date=True)
        page2.save()
        resp = self.client.get(reverse('home'))
        resp.text = resp.content.decode('utf-8')
        self.assertIn(page1.title, resp.text)
        self.assertIn(page1.url, resp.text)
        self.assertIn(page1.birth_date, resp.text)
        self.assertIn(page2.title, resp.text)
        self.assertIn(page2.url, resp.text)
        self.assertIn(page2.birth_date, resp.text)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号