mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-30 05:24:00 +03:00
Merge pull request #2588 from maryokhin/master
Check if sessions are enabled before calling logout.
This commit is contained in:
commit
d0539a11e9
|
@ -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):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user