test_all_users_listing.py 文件源码

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

项目:Cycling_admin 作者: Social-projects-Rivne 项目源码 文件源码
def test_unavailable_db(self):
        """
        Check if "Can not access database" message appears if db is
        unavailable.
        """
        #break db uri to call exception inside controller
        app.config['SQLALCHEMY_DATABASE_URI'] = ''
        with app.test_client() as test_client:
            responce = test_client.get('/users/all')
            data = responce.data
            self.assertIn("Can not access database.", data)
            self.assertNotIn('<table class="table">', data)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号