Don’t update email_access_validated_at on password reset

As of https://github.com/alphagov/notifications-admin/pull/4000/files
the admin app is doing this, so we don’t need to do it here as well.
This commit is contained in:
Chris Hill-Scott
2021-08-17 16:59:51 +01:00
parent 43f010ea1b
commit 2c7e4657ce
4 changed files with 6 additions and 27 deletions

View File

@@ -791,30 +791,18 @@ def test_send_user_confirm_new_email_returns_400_when_email_missing(client, samp
mocked.assert_not_called()
@pytest.mark.parametrize('data,email_access_validated_at', [
({'_password': '1234567890'}, datetime(2020, 2, 13, 12, 0)),
({
'_password': '1234567890',
'validated_email_access': True,
}, datetime(2020, 2, 14, 12, 0)),
({
'_password': '1234567890',
'validated_email_access': False,
}, datetime(2020, 2, 13, 12, 0))
])
@freeze_time('2020-02-14T12:00:00')
def test_update_user_password_saves_correctly(client, sample_service, data, email_access_validated_at):
def test_update_user_password_saves_correctly(client, sample_service):
sample_user = sample_service.users[0]
sample_user.email_access_validated_at = datetime(2020, 2, 13, 12, 0)
new_password = '1234567890'
auth_header = create_admin_authorization_header()
headers = [('Content-Type', 'application/json'), auth_header]
data = {'_password': '1234567890'}
resp = client.post(
url_for('user.update_password', user_id=sample_user.id),
data=json.dumps(data),
headers=headers)
assert resp.status_code == 200
assert sample_user.email_access_validated_at == email_access_validated_at
json_resp = json.loads(resp.get_data(as_text=True))
assert json_resp['data']['password_changed_at'] is not None