mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-19 14:09:20 -04:00
Add endpoints for forgot-password.
This commit is contained in:
16
tests/app/main/views/test_forgot_password.py
Normal file
16
tests/app/main/views/test_forgot_password.py
Normal 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)
|
||||
Reference in New Issue
Block a user