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

wants to merge 5 commits into

3 participants


No description provided.

Django member

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.


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 Django member

This line is now an unused import


@mjtamlyn thanks!

Django member

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

Django member

This patch will now need updating for custom user models.

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