mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-05 16:38:59 -04:00
Add loops for changing each part of your profile
This commit adds a page or series of pages for changing your:
Name | Email address | Mobile number | Password
------------------|-------------------|-------------------|------------
Enter new value | Enter new value | Enter new value | Enter new value
| Enter 2fa code | Enter 2fa code |
Return to profile | Return to profile | Return to profile | Return to profile
(each row is a page)
This commit is contained in:
@@ -3,3 +3,89 @@ def test_should_show_overview_page(notifications_admin):
|
||||
|
||||
assert 'Your profile' in response.get_data(as_text=True)
|
||||
assert response.status_code == 200
|
||||
|
||||
|
||||
def test_should_show_name_page(notifications_admin):
|
||||
response = notifications_admin.test_client().get('/user-profile/name')
|
||||
|
||||
assert 'Change your name' in response.get_data(as_text=True)
|
||||
assert response.status_code == 200
|
||||
|
||||
|
||||
def test_should_redirect_after_name_change(notifications_admin):
|
||||
response = notifications_admin.test_client().post('/user-profile/name')
|
||||
|
||||
assert response.status_code == 302
|
||||
assert response.location == 'http://localhost/user-profile'
|
||||
|
||||
|
||||
def test_should_show_email_page(notifications_admin):
|
||||
response = notifications_admin.test_client().get('/user-profile/email')
|
||||
|
||||
assert 'Change your email address' in response.get_data(as_text=True)
|
||||
assert response.status_code == 200
|
||||
|
||||
|
||||
def test_should_redirect_after_email_change(notifications_admin):
|
||||
response = notifications_admin.test_client().post('/user-profile/email')
|
||||
|
||||
assert response.status_code == 302
|
||||
assert response.location == 'http://localhost/user-profile/email/confirm'
|
||||
|
||||
|
||||
def test_should_show_confirm_after_email_change(notifications_admin):
|
||||
response = notifications_admin.test_client().get('/user-profile/email/confirm')
|
||||
|
||||
assert 'Change your email address' in response.get_data(as_text=True)
|
||||
assert 'Confirm' in response.get_data(as_text=True)
|
||||
assert response.status_code == 200
|
||||
|
||||
|
||||
def test_should_redirect_after_email_change_confirm(notifications_admin):
|
||||
response = notifications_admin.test_client().post('/user-profile/email/confirm')
|
||||
|
||||
assert response.status_code == 302
|
||||
assert response.location == 'http://localhost/user-profile'
|
||||
|
||||
|
||||
def test_should_show_mobile_number_page(notifications_admin):
|
||||
response = notifications_admin.test_client().get('/user-profile/mobile-number')
|
||||
|
||||
assert 'Change your mobile number' in response.get_data(as_text=True)
|
||||
assert response.status_code == 200
|
||||
|
||||
|
||||
def test_should_redirect_after_mobile_number_change(notifications_admin):
|
||||
response = notifications_admin.test_client().post('/user-profile/email')
|
||||
|
||||
assert response.status_code == 302
|
||||
assert response.location == 'http://localhost/user-profile/email/confirm'
|
||||
|
||||
|
||||
def test_should_show_confirm_after_mobile_number_change(notifications_admin):
|
||||
response = notifications_admin.test_client().get('/user-profile/mobile-number/confirm')
|
||||
|
||||
assert 'Change your mobile number' in response.get_data(as_text=True)
|
||||
assert 'Confirm' in response.get_data(as_text=True)
|
||||
assert response.status_code == 200
|
||||
|
||||
|
||||
def test_should_redirect_after_mobile_number_confirm(notifications_admin):
|
||||
response = notifications_admin.test_client().post('/user-profile/mobile-number/confirm')
|
||||
|
||||
assert response.status_code == 302
|
||||
assert response.location == 'http://localhost/user-profile'
|
||||
|
||||
|
||||
def test_should_show_password_page(notifications_admin):
|
||||
response = notifications_admin.test_client().get('/user-profile/password')
|
||||
|
||||
assert 'Change your password' in response.get_data(as_text=True)
|
||||
assert response.status_code == 200
|
||||
|
||||
|
||||
def test_should_redirect_after_password_change(notifications_admin):
|
||||
response = notifications_admin.test_client().post('/user-profile/password')
|
||||
|
||||
assert response.status_code == 302
|
||||
assert response.location == 'http://localhost/user-profile'
|
||||
|
||||
Reference in New Issue
Block a user