Skip to content

Commit

Permalink
adding test for different http response code
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-bell authored and aleksihakli committed Aug 19, 2021
1 parent 6858aea commit 2368a7a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,11 @@ def test_get_lockout_response(self):
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)
Expand Down

0 comments on commit 2368a7a

Please sign in to comment.