mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-03 23:51:22 -04:00
Refactor failed login count
We don’t vary this between different environments so it doesn’t need to be in the config. I was trying to look up what this value was and found it a bit confusing that it was spread across multiple places.
This commit is contained in:
@@ -33,12 +33,12 @@ def test_user(app_):
|
||||
assert user.state == 'pending'
|
||||
|
||||
# user has ten failed logins before being locked
|
||||
assert user.max_failed_login_count == app_.config['MAX_FAILED_LOGIN_COUNT'] == 10
|
||||
assert user.MAX_FAILED_LOGIN_COUNT == 10
|
||||
assert user.failed_login_count == 0
|
||||
assert user.locked is False
|
||||
|
||||
# set failed logins to threshold
|
||||
user.failed_login_count = app_.config['MAX_FAILED_LOGIN_COUNT']
|
||||
user.failed_login_count = 10
|
||||
assert user.locked is True
|
||||
|
||||
with pytest.raises(TypeError):
|
||||
|
||||
Reference in New Issue
Block a user