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:
Chris Hill-Scott
2021-03-19 14:11:37 +00:00
parent 62ce3c0696
commit 6c8bfdc5b0
3 changed files with 6 additions and 6 deletions

View File

@@ -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):