Merge pull request #2588 from maryokhin/master

Check if sessions are enabled before calling logout.
This commit is contained in:
Tom Christie 2015-02-20 20:28:20 +00:00
commit d0539a11e9

View File

@ -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):