Check if sessions are enabled before calling logout. Closes #2545.

This commit is contained in:
Tymur Maryokhin 2015-02-20 20:12:39 +01:00
parent dc8cc86077
commit 7345830c88

View File

@ -209,7 +209,8 @@ class APIClient(APIRequestFactory, DjangoClient):
self.handler._force_user = None self.handler._force_user = None
self.handler._force_token = None self.handler._force_token = None
return super(APIClient, self).logout() if self.session:
super(APIClient, self).logout()
class APITransactionTestCase(testcases.TransactionTestCase): class APITransactionTestCase(testcases.TransactionTestCase):