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

wants to merge 5 commits into


None yet

3 participants

awsum commented Sep 4, 2012

No description provided.

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 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
@@ -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 Sep 7, 2012 Member

This line is now an unused import

awsum commented Sep 7, 2012

@mjtamlyn thanks!

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.


This patch will now need updating for custom user models.


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