def test_bypass_login(self):
create_user()
with self.app.test_client() as c:
with c.session_transaction() as sess:
sess['user_id'] = '1'
sess['_fresh'] = True
rv = c.get('/', follow_redirects=True)
six.assertRegex(self, str(rv.data), r'logout', "response contains text 'logout'")
评论列表
文章目录