AccountTests.py 文件源码

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

项目:mltshp 作者: MLTSHP 项目源码 文件源码
def test_reset_password_finish(self):
        """
        Posting the actual reset-password will reset it
        """
        self.user.create_reset_password_token()

        self.http_client.fetch(self.get_url("/account/reset-password/%s" % (self.user.reset_password_token)), self.stop)
        response = self.wait()

        request = HTTPRequest(
                    url = self.get_url("/account/reset-password/%s" % (self.user.reset_password_token)),
                    method='POST',
                    headers={"Cookie":"_xsrf=%s" % (self.xsrf)},
                    body="password=%s&password_again=%s&_xsrf=%s" % ("qwertyqwerty", "qwertyqwerty", self.xsrf)
                    )
        self.http_client.fetch(request, self.stop)
        response = self.wait()

        self.user = User.get("id=%s", 1)
        self.assertEqual(self.user.reset_password_token, "")
        self.assertEqual(self.user.hashed_password, User.generate_password_digest('qwertyqwerty'))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号