def test_user_can_change_password_if_they_match(mockdata, client, session): with current_app.test_request_context(): login_user(client) form = ChangePasswordForm(old_password='******', password='******', password2='validpasswd') rv = client.post(url_for('auth.change_password'), data=form.data, follow_redirects=True) assert 'Your password has been updated.' in rv.data
def test_user_cannot_change_password_if_they_dont_match( mockdata, client, session): with current_app.test_request_context(): login_user(client) form = ChangePasswordForm(old_password='******', password='******', password2='butts') rv = client.post(url_for('auth.change_password'), data=form.data, follow_redirects=True) assert 'Passwords must match' in rv.data