MCPcopy
hub / github.com/django/django / logout

Method logout

django/test/client.py:919–931  ·  view source on GitHub ↗

Log out the user by removing the cookies and session object.

(self)

Source from the content-addressed store, hash-verified

917 self.cookies[session_cookie].update(cookie_data)
918
919 def logout(self):
920 """Log out the user by removing the cookies and session object."""
921 from django.contrib.auth import get_user, logout
922
923 request = HttpRequest()
924 if self.session:
925 request.session = self.session
926 request.user = get_user(request)
927 else:
928 engine = import_module(settings.SESSION_ENGINE)
929 request.session = engine.SessionStore()
930 logout(request)
931 self.cookies = SimpleCookie()
932
933 async def alogout(self):
934 """See logout()."""

Callers

nothing calls this directly

Calls 3

HttpRequestClass · 0.90
get_userFunction · 0.90
logoutFunction · 0.90

Tested by

no test coverage detected