-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Client.logout()
also cancels any existing force_authenticate
.
#2218
Comments
Could you also include an example of how the behaviour changes? That'd be super helpful for review. |
For instance, we have a base test class that looks something like this:
And a test that tests redirect in the home view:
With I could be wrong but I would guess it is much more common to authenticate by default in a test, which is why I suggested the above. Also I am aware that I can alternatively call |
I don't want to see the |
Client.logout()
should also cancel any previous .force_authenticate()
I second the removal of |
Thanks, always helpful to have a second review :) |
Client.logout()
should also cancel any previous .force_authenticate()
Client.logout()
also cancels any existing force_authenticate
.
Hello
Currently
logout()
does not technically "log out" a user in a test ifforce_authenticate
is enabled.I think it would make more sense if the forced authentication was cancelled by default since I think it is more common that "logout" called from within a test would subsequently be testing unauthenticated behavior. (In our case, all tests use
force_authenticate
by default).Current implementation:
Proposed implementation:
P.S. I would have made a PR for this but you might not agree with the change so I am just making an issue to suggest it.
Regards,
-- Ryan
The text was updated successfully, but these errors were encountered: