Add endpoints for forgot-password.

This commit is contained in:
Rebecca Law
2016-01-04 14:00:39 +00:00
parent 567ac123e3
commit 6696426dbc
10 changed files with 145 additions and 11 deletions

View File

@@ -0,0 +1,16 @@
from flask import current_app
def test_should_render_forgot_password(notifications_admin, notifications_admin_db, notify_db_session):
response = notifications_admin.test_client().get('/forgot-password')
assert response.status_code == 200
assert 'If you have forgotten your password, we can send you an email to create a new password.' \
in response.get_data(as_text=True)
def test_should_return_400_when_email_is_invalid(notifications_admin, notifications_admin_db, notify_db_session):
response = notifications_admin.test_client().post('/forgot-password',
data={'email_address': 'not_a_valid_email'})
x = current_app._get_current_object()
assert response.status_code == 400
assert 'Please enter a valid email address' in response.get_data(as_text=True)