aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/test.py
diff options
context:
space:
mode:
Diffstat (limited to 'rest_framework/test.py')
-rw-r--r--rest_framework/test.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/rest_framework/test.py b/rest_framework/test.py
index 4f4b7c20..a83d082a 100644
--- a/rest_framework/test.py
+++ b/rest_framework/test.py
@@ -209,7 +209,8 @@ class APIClient(APIRequestFactory, DjangoClient):
self.handler._force_user = None
self.handler._force_token = None
- return super(APIClient, self).logout()
+ if self.session:
+ super(APIClient, self).logout()
class APITransactionTestCase(testcases.TransactionTestCase):