mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-10 19:56:59 +03:00
Check if sessions are enabled before calling logout. Closes #2545.
This commit is contained in:
parent
dc8cc86077
commit
7345830c88
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue
Block a user