def test_retry_header_formatted_correctly(client): ex = APIException(mock_detail) ex.wait = "30" response = custom_exception_handler(ex, {}) assert response.status_code == 500 assert response["Retry-After"] == "30"