added one more unit test, and added a coverage ignore to a line

This commit is contained in:
Ken Cochrane 2015-01-02 16:10:12 -05:00
parent 6f0f5c26f2
commit 34060b1eb1
2 changed files with 6 additions and 1 deletions

View file

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

View file

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