mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-26 05:11:06 -05:00
Keep Last changed text.
Update user test data to include the password_changed_at attribute.
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
{'label': 'Name', 'value': current_user.name, 'url': url_for('.user_profile_name')},
|
||||
{'label': 'Email address', 'value': current_user.email_address, 'url': url_for('.user_profile_email')},
|
||||
{'label': 'Mobile number', 'value': current_user.mobile_number, 'url': url_for('.user_profile_mobile_number')},
|
||||
{'label': 'Password', 'value': current_user.password_changed_at |format_datetime_short, 'url': url_for('.user_profile_password')},
|
||||
{'label': 'Password', 'value': 'Last changed ' + current_user.password_changed_at |format_datetime_short, 'url': url_for('.user_profile_password')},
|
||||
],
|
||||
caption='Account settings',
|
||||
field_headings=['Setting', 'Value', 'Link to change'],
|
||||
|
||||
@@ -423,7 +423,8 @@ def api_user_pending(fake_uuid):
|
||||
'mobile_number': '07700 900762',
|
||||
'state': 'pending',
|
||||
'failed_login_count': 0,
|
||||
'permissions': {}
|
||||
'permissions': {},
|
||||
'password_changed_at': str(datetime.utcnow())
|
||||
}
|
||||
user = User(user_data)
|
||||
return user
|
||||
@@ -440,7 +441,8 @@ def platform_admin_user(fake_uuid):
|
||||
'state': 'active',
|
||||
'failed_login_count': 0,
|
||||
'permissions': {},
|
||||
'platform_admin': True
|
||||
'platform_admin': True,
|
||||
'password_changed_at': str(datetime.utcnow())
|
||||
}
|
||||
user = User(user_data)
|
||||
return user
|
||||
@@ -483,7 +485,8 @@ def active_user_with_permissions(fake_uuid):
|
||||
'manage_settings',
|
||||
'manage_api_keys',
|
||||
'view_activity']},
|
||||
'platform_admin': False
|
||||
'platform_admin': False,
|
||||
'password_changed_at': str(datetime.utcnow())
|
||||
}
|
||||
user = User(user_data)
|
||||
return user
|
||||
@@ -499,7 +502,8 @@ def api_user_locked(fake_uuid):
|
||||
'mobile_number': '07700 900762',
|
||||
'state': 'active',
|
||||
'failed_login_count': 5,
|
||||
'permissions': {}
|
||||
'permissions': {},
|
||||
'password_changed_at': str(datetime.utcnow())
|
||||
}
|
||||
user = User(user_data)
|
||||
return user
|
||||
@@ -516,7 +520,7 @@ def api_user_request_password_reset(fake_uuid):
|
||||
'state': 'active',
|
||||
'failed_login_count': 5,
|
||||
'permissions': {},
|
||||
'password_changed_at': None
|
||||
'password_changed_at': str(datetime.utcnow())
|
||||
}
|
||||
user = User(user_data)
|
||||
return user
|
||||
@@ -546,6 +550,7 @@ def mock_register_user(mocker, api_user_pending):
|
||||
api_user_pending.email_address = email_address
|
||||
api_user_pending.mobile_number = mobile_number
|
||||
api_user_pending.password = password
|
||||
|
||||
return api_user_pending
|
||||
|
||||
return mocker.patch('app.user_api_client.register_user', side_effect=_register)
|
||||
@@ -701,7 +706,6 @@ def mock_get_all_users_from_api(mocker):
|
||||
@pytest.fixture(scope='function')
|
||||
def mock_create_api_key(mocker):
|
||||
def _create(service_id, key_name):
|
||||
import uuid
|
||||
return {'data': str(generate_uuid())}
|
||||
|
||||
return mocker.patch('app.api_key_api_client.create_api_key', side_effect=_create)
|
||||
|
||||
Reference in New Issue
Block a user