adding test for different http response code

This commit is contained in:
phil-bell 2021-08-17 16:17:24 +01:00 committed by Aleksi Häkli
parent 6858aea99a
commit 2368a7af38

View file

@ -677,6 +677,11 @@ class AxesLockoutTestCase(AxesTestCase):
response = get_lockout_response(self.request, self.credentials)
self.assertEqual(403, response.status_code)
@override_settings(AXES_HTTP_RESPONSE_CODE=429)
def test_get_lockout_response_with_custom_http_response_code(self):
response = get_lockout_response(self.request, self.credentials)
self.assertEqual(429, response.status_code)
@override_settings(AXES_LOCKOUT_CALLABLE=mock_get_lockout_response)
def test_get_lockout_response_override_callable(self):
response = get_lockout_response(self.request, self.credentials)