aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/test.py
diff options
context:
space:
mode:
authorTom Christie2014-12-12 13:13:08 +0000
committerTom Christie2014-12-12 13:13:08 +0000
commit78312d44d1e1a7f43daacd1614be2008eb77a0de (patch)
treeb8f9b68fbbf36ae5aad05e9e2ef60b2da22554b5 /rest_framework/test.py
parent903fb5ff96615064bf33cfb1dc9882fffe90f5c4 (diff)
downloaddjango-rest-framework-78312d44d1e1a7f43daacd1614be2008eb77a0de.tar.bz2
Client.logout() also clears any force_authenticate
Diffstat (limited to 'rest_framework/test.py')
-rw-r--r--rest_framework/test.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/rest_framework/test.py b/rest_framework/test.py
index 74d2c868..4f4b7c20 100644
--- a/rest_framework/test.py
+++ b/rest_framework/test.py
@@ -204,6 +204,11 @@ class APIClient(APIRequestFactory, DjangoClient):
def logout(self):
self._credentials = {}
+
+ # Also clear any `force_authenticate`
+ self.handler._force_user = None
+ self.handler._force_token = None
+
return super(APIClient, self).logout()