FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects

feat: correct password app reset token call and handle missing users

Merged Robin Goodall requested to merge fix-reset-token-call into main
All threads resolved!
1 file
+ 18
1
Compare changes
  • Side-by-side
  • Inline
@@ -40,6 +40,23 @@ def failed_reset_token_response(requests_mock):
def test_failed_reset_token(authenticated_api_client, url, failed_reset_token_response):
response = authenticated_api_client.get(url)
assert response.status_code == status.HTTP_500_INTERNAL_SERVER_ERROR
assert response.status_code == status.HTTP_503_SERVICE_UNAVAILABLE
# Initial call then PASSWORD_APP_RETRIES retries
assert failed_reset_token_response.call_count == PASSWORD_APP_RETRIES + 1
@pytest.fixture
def missing_user_reset_token_response(requests_mock):
return requests_mock.get(
settings.PASSWORD_APP_RESET_TOKEN_URL, status_code=404, reason="User not found"
)
def test_missing_user_reset_token(
authenticated_api_client, url, missing_user_reset_token_response
):
response = authenticated_api_client.get(url)
assert response.status_code == status.HTTP_400_BAD_REQUEST
# Call once and not retried
assert missing_user_reset_token_response.call_count == 1
Loading