mirror of
https://github.com/jazzband/django-defender.git
synced 2026-03-16 22:10:32 +00:00
added one more unit test, and added a coverage ignore to a line
This commit is contained in:
parent
6f0f5c26f2
commit
34060b1eb1
2 changed files with 6 additions and 1 deletions
|
|
@ -34,7 +34,7 @@ REVERSE_PROXY_HEADER = get_setting('DEFENDER_REVERSE_PROXY_HEADER',
|
|||
try:
|
||||
# how long to wait before the bad login attempt gets forgotten. in seconds.
|
||||
COOLOFF_TIME = int(get_setting('DEFENDER_COOLOFF_TIME', 300)) # seconds
|
||||
except ValueError:
|
||||
except ValueError: # pragma: no cover
|
||||
raise Exception('COOLOFF_TIME needs to be an integer') # pragma: no cover
|
||||
|
||||
LOCKOUT_TEMPLATE = get_setting('DEFENDER_LOCKOUT_TEMPLATE')
|
||||
|
|
|
|||
|
|
@ -81,6 +81,11 @@ class AccessAttemptTest(TestCase):
|
|||
""" clean up the db """
|
||||
mock_get_connection().flushdb()
|
||||
|
||||
def test_login_get(self):
|
||||
""" visit the login page """
|
||||
response = self.client.get(ADMIN_LOGIN_URL)
|
||||
self.assertEquals(response.status_code, 200)
|
||||
|
||||
def test_failure_limit_once(self):
|
||||
""" Tests the login lock trying to login one more time
|
||||
than failure limit
|
||||
|
|
|
|||
Loading…
Reference in a new issue