From fcec755f01cfaba2a85bfc9511876debbce98631 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Fri, 17 Aug 2007 15:05:54 +0000 Subject: newforms-admin: Merged from trunk up to [5916] git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@5918 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/test/client.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'django/test/client.py') diff --git a/django/test/client.py b/django/test/client.py index 7e62715205..9ec3615973 100644 --- a/django/test/client.py +++ b/django/test/client.py @@ -253,3 +253,14 @@ class Client: else: return False + def logout(self): + """Removes the authenticated user's cookies. + + Causes the authenticated user to be logged out. + """ + try: + Session.objects.get(session_key=self.cookies['sessionid'].value).delete() + except KeyError: + pass + + self.cookies = SimpleCookie() -- cgit v1.3