mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-19 14:09:20 -04:00
Use password_changed_at field from User object rather than use a hard coded date.
https://www.pivotaltracker.com/story/show/122205615
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -22,6 +22,7 @@ var/
|
|||||||
*.egg-info/
|
*.egg-info/
|
||||||
.installed.cfg
|
.installed.cfg
|
||||||
*.egg
|
*.egg
|
||||||
|
venv/
|
||||||
|
|
||||||
# PyInstaller
|
# PyInstaller
|
||||||
# Usually these files are written by a python script from a template
|
# Usually these files are written by a python script from a template
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
{'label': 'Name', 'value': current_user.name, 'url': url_for('.user_profile_name')},
|
{'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': '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': 'Mobile number', 'value': current_user.mobile_number, 'url': url_for('.user_profile_mobile_number')},
|
||||||
{'label': 'Password', 'value': 'Last changed 1 January 2016, 10:00AM', 'url': url_for('.user_profile_password')},
|
{'label': 'Password', 'value': current_user.password_changed_at |format_datetime_short, 'url': url_for('.user_profile_password')},
|
||||||
],
|
],
|
||||||
caption='Account settings',
|
caption='Account settings',
|
||||||
field_headings=['Setting', 'Value', 'Link to change'],
|
field_headings=['Setting', 'Value', 'Link to change'],
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import uuid
|
|
||||||
from datetime import date, datetime, timedelta
|
from datetime import date, datetime, timedelta
|
||||||
from unittest.mock import Mock
|
from unittest.mock import Mock
|
||||||
import pytest
|
import pytest
|
||||||
@@ -458,7 +457,8 @@ def api_user_active(fake_uuid):
|
|||||||
'state': 'active',
|
'state': 'active',
|
||||||
'failed_login_count': 0,
|
'failed_login_count': 0,
|
||||||
'permissions': {},
|
'permissions': {},
|
||||||
'platform_admin': False
|
'platform_admin': False,
|
||||||
|
'password_changed_at': str(datetime.utcnow())
|
||||||
}
|
}
|
||||||
user = User(user_data)
|
user = User(user_data)
|
||||||
return user
|
return user
|
||||||
|
|||||||
Reference in New Issue
Block a user