test.Client.logout()

logout() [source]

If your site uses Django’s authentication system, the logout() method can be used to simulate the effect of a user logging out of your site.

After you call this method, the test client will have all the cookies and session data cleared to defaults. Subsequent requests will appear to come from an AnonymousUser.

doc_Django
2016-10-09 18:39:56
Comments
Leave a Comment

Please login to continue.