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)
test_all_users_listing.py 文件源码
python
阅读 23
收藏 0
点赞 0
评论 0
评论列表
文章目录