def test_change_password(): '''Assert that the password field has been updated to a new password''' user_id = 3 user_name = 'mladmin' user_new_password = passphrase_functions.gen_pw(3) change_pw_result = core.change_pw(user_id, user_new_password) authenticate_result = core.authenticate(user_name, user_new_password) tools.assert_equals(change_pw_result, 'Your password has been updated') tools.assert_equals(authenticate_result.id, user_id)
def login(): err_msg = 'Incorrect username or password.' username = request.form['username'] password = request.form['password'] authenticated = core.authenticate(username, password) if authenticated == None: flash(err_msg) return redirect('/') else: session['username'] = authenticated.username session['id'] = authenticated.id return redirect('/dashboard')
def add_result_db(item, date, http_result, post_user, post_pw): user = core.authenticate(post_user, post_pw) if user is not None: core.add_result(item.url.id, date, http_result['code'], http_result['time'])
def authenticate_agent(self, email, password, hashed_password): return core.authenticate(email, password, hashed_password)