Skip to content

Ticket #18924. Made test.Client.logout send user_logged_out signal. #322

Closed
wants to merge 5 commits into from

3 participants

@awsum
awsum commented Sep 4, 2012

No description provided.

@mjtamlyn
Django member
mjtamlyn commented Sep 6, 2012

Does this have an associated ticket?

It seems to me it would be preferable to implement this in a similar way to the login method and call the django.contrib.auth.logout function. I think that will make the tests pass as you've written them, but will also keep the code base a bit cleaner.

@awsum
awsum commented Sep 7, 2012

Created ticket #18924 for this.

Reusing django.contrib.auth.logout is indeed a good idea, added commit here. Also after looking at method closely found out that behaviour for not authorized User was incorrect, also cover that in last commit.

@mjtamlyn mjtamlyn commented on an outdated diff Sep 7, 2012
django/test/client.py
@@ -13,7 +13,8 @@
from urlparse import urlparse, urlsplit
from django.conf import settings
-from django.contrib.auth import authenticate, login
+from django.contrib.auth import authenticate, login, logout
+from django.contrib.auth.signals import user_logged_out
@mjtamlyn
Django member
mjtamlyn added a note Sep 7, 2012

This line is now an unused import

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@awsum
awsum commented Sep 7, 2012

@mjtamlyn thanks!

@mjtamlyn
Django member
mjtamlyn commented Sep 7, 2012

I made a little comment on the ticket about release notes as well, but I'll mark it as RFC.

@mjtamlyn
Django member

This patch will now need updating for custom user models.

@apollo13
Django member

Superseeded by #731.

@apollo13 apollo13 closed this Feb 24, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.