mirror of
https://github.com/jazzband/django-axes.git
synced 2026-05-15 02:54:52 +00:00
Add unit tests for security check W006
This commit is contained in:
parent
f2af7c993b
commit
3f20e86710
1 changed files with 17 additions and 0 deletions
|
|
@ -129,3 +129,20 @@ class ConfCheckTestCase(AxesTestCase):
|
|||
def test_valid_callable(self):
|
||||
warnings = run_checks()
|
||||
self.assertEqual(warnings, [])
|
||||
|
||||
|
||||
class LockoutParametersCheckTestCase(AxesTestCase):
|
||||
@override_settings(AXES_LOCKOUT_PARAMETERS=["ip_address", "username"])
|
||||
def test_valid_configuration(self):
|
||||
warnings = run_checks()
|
||||
self.assertEqual(warnings, [])
|
||||
|
||||
@override_settings(AXES_LOCKOUT_PARAMETERS=["username", "user_agent"])
|
||||
def test_invalid_configuration(self):
|
||||
warnings = run_checks()
|
||||
warning = Warning(
|
||||
msg=Messages.LOCKOUT_PARAMETERS_INVALID,
|
||||
hint=Hints.LOCKOUT_PARAMETERS_INVALID,
|
||||
id=Codes.LOCKOUT_PARAMETERS_INVALID,
|
||||
)
|
||||
self.assertEqual(warnings, [warning])
|
||||
Loading…
Reference in a new issue