本文整理汇总了Python中bespin.tests.BespinTestApp.reset方法的典型用法代码示例。如果您正苦于以下问题:Python BespinTestApp.reset方法的具体用法?Python BespinTestApp.reset怎么用?Python BespinTestApp.reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bespin.tests.BespinTestApp
的用法示例。
在下文中一共展示了BespinTestApp.reset方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_password_change_bad_code
# 需要导入模块: from bespin.tests import BespinTestApp [as 别名]
# 或者: from bespin.tests.BespinTestApp import reset [as 别名]
def test_password_change_bad_code():
config.set_profile("test")
config.activate_profile()
_clear_db()
app = controllers.make_app()
app = BespinTestApp(app)
resp = app.post('/register/new/BillBixby', dict(email="[email protected]",
password="notangry"))
app.reset()
resp = app.post('/register/password/BillBixby', dict(
code="42",
newPassword="hatetraffic"),
status=400)
示例2: test_password_change_with_confirmation_code
# 需要导入模块: from bespin.tests import BespinTestApp [as 别名]
# 或者: from bespin.tests.BespinTestApp import reset [as 别名]
def test_password_change_with_confirmation_code():
config.set_profile("test")
config.activate_profile()
_clear_db()
app = controllers.make_app()
app = BespinTestApp(app)
resp = app.post('/register/new/BillBixby', dict(email="[email protected]",
password="notangry"))
app.reset()
user = User.find_user("BillBixby")
verify_code = controllers._get_password_verify_code(user)
resp = app.post('/register/password/BillBixby', dict(
code=verify_code,
newPassword="hatetraffic"))
user = User.find_user('BillBixby', 'hatetraffic')
assert user
示例3: test_lost_password_request
# 需要导入模块: from bespin.tests import BespinTestApp [as 别名]
# 或者: from bespin.tests.BespinTestApp import reset [as 别名]
def test_lost_password_request(send_text_email):
config.set_profile("test")
config.activate_profile()
_clear_db()
app = controllers.make_app()
app = BespinTestApp(app)
resp = app.post('/register/new/BillBixby', dict(email="[email protected]",
password="notangry"))
app.reset()
resp = app.post('/register/lost/', dict(username='BillBixby'))
assert send_text_email.called
args = send_text_email.call_args[0]
assert args[0] == '[email protected]'
assert args[1].startswith("Requested password change for ")
user = User.find_user("BillBixby")
verify_code = controllers._get_password_verify_code(user)
assert verify_code in args[2]