mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 23:26:23 -05:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user