def test_reset_pw(): ''' Check to make sure a valid user returns password reset successful message. Running this test will change the password in the db, so make sure to use a test account (or figure out how to use mock to force a result). NOTE: this test will error if environment variables for alerts.py are not set.''' user_name = 'mladmin' email_address = '*****@*****.**' result = core.reset_pw(user_name, email_address) tools.assert_equals(result, 'Password reset. Please check your email for your new password.')
def test_reset_pw_unknown_user(): '''make sure error message is returned if user is not found in database''' user_name = 'madmin' email_address = 'none' result = core.reset_pw(user_name, email_address) tools.assert_equals(result, 'Your account was not found in our system. Do you have the correct username and email address?')