From 7d64b77e5d1a820c87d4cd9b4b71ff5fe4846d7d Mon Sep 17 00:00:00 2001 From: Rebecca Law Date: Mon, 27 Jun 2016 17:03:15 +0100 Subject: [PATCH] Use password_changed_at field from User object rather than use a hard coded date. https://www.pivotaltracker.com/story/show/122205615 --- .gitignore | 1 + app/templates/views/user-profile.html | 2 +- tests/conftest.py | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index af6a67fe5..2ff4784bb 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ var/ *.egg-info/ .installed.cfg *.egg +venv/ # PyInstaller # Usually these files are written by a python script from a template diff --git a/app/templates/views/user-profile.html b/app/templates/views/user-profile.html index 9fa19d05c..1291a3e63 100644 --- a/app/templates/views/user-profile.html +++ b/app/templates/views/user-profile.html @@ -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': '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', field_headings=['Setting', 'Value', 'Link to change'], diff --git a/tests/conftest.py b/tests/conftest.py index 8036a8e74..a2c2ce4e0 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,4 +1,3 @@ -import uuid from datetime import date, datetime, timedelta from unittest.mock import Mock import pytest @@ -458,7 +457,8 @@ def api_user_active(fake_uuid): 'state': 'active', 'failed_login_count': 0, 'permissions': {}, - 'platform_admin': False + 'platform_admin': False, + 'password_changed_at': str(datetime.utcnow()) } user = User(user_data) return user