Skip to content

feat: improve TokenBlacklistSerializer return values #901

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

juanbailon
Copy link
Contributor

@juanbailon juanbailon commented Apr 2, 2025

  • Raise TokenBlacklistNotConfigured exception when token_blacklist app is not installed, returning an error message and a 501 Not Implemented status code.

    • Previously, it returned 200 OK with no message when the blacklist app was missing, which was misleading because it implied the token was successfully blacklisted when, in reality, no blacklisting occurred
  • Return a success message ('Token blacklisted') when a token is successfully blacklisted.

  • Update tests to reflect the new return behavior.

Tackles Issue #742

Tests name changes

In test_views.py

  • test_it_should_return_nothing_if_everything_ok --> test_it_should_return_message_if_everything_ok

In test_serializers.py

  • test_blacklist_app_not_installed_should_pass --> test_blacklist_app_not_installed_should_raise_token_blacklist_not_configured

juanbailon and others added 2 commits April 2, 2025 04:56
- Raise  exception when token_blacklist app is not enabled or available.
- Return a success message ('Token blacklisted') when a token is successfully blacklisted.
- Update tests to reflect the new return behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant