def test_password_from_html_vars_change_pw(request_context): html.request.set_var( "pw_orig", base64.b64encode(Encrypter.encrypt("abc")).decode("ascii")) html.request.set_var("pw", "xyz") pw = vs.Password() assert pw.from_html_vars("pw") == "xyz"
def test_password_from_html_vars_change_pw(request_context): html.request.set_var("pw_orig", vs.ValueEncrypter.encrypt("abc")) html.request.set_var("pw", "xyz") pw = vs.Password() assert pw.from_html_vars("pw") == "xyz"
def test_password_from_html_vars_initial_pw(request_context): html.request.set_var("pw_orig", "") html.request.set_var("pw", "abc") pw = vs.Password() assert pw.from_html_vars("pw") == "abc"
def test_password_from_html_vars_not_set(request_context): pw = vs.Password() assert pw.from_html_vars("pw") == ""
def test_password_from_html_vars_empty(request_context): html.request.set_var("pw_orig", "") html.request.set_var("pw", "") pw = vs.Password() assert pw.from_html_vars("pw") == ""
def test_password_from_html_vars_unchanged_pw(register_builtin_html): html.request.set_var("pw_orig", vs.ValueEncrypter.encrypt("abc")) html.request.set_var("pw", "") pw = vs.Password() assert pw.from_html_vars("pw") == "abc"
def test_password_from_html_vars_not_set(register_builtin_html): pw = vs.Password() assert pw.from_html_vars("pw") == ""
def test_password_from_html_vars_empty(register_builtin_html): html.request.set_var("pw_orig", "") html.request.set_var("pw", "") pw = vs.Password() assert pw.from_html_vars("pw") == ""