diff options
| author | Tom Christie | 2014-12-12 13:33:06 +0000 | 
|---|---|---|
| committer | Tom Christie | 2014-12-12 13:33:06 +0000 | 
| commit | fd473aa905337908b41c9a1087967a19f0558f89 (patch) | |
| tree | d72f3f613bbe51716355b9d1d68e5905c2bb2307 /rest_framework/test.py | |
| parent | 903fb5ff96615064bf33cfb1dc9882fffe90f5c4 (diff) | |
| parent | 8825b258caa0c51d6dcdb3529dc433c75a76339d (diff) | |
| download | django-rest-framework-fd473aa905337908b41c9a1087967a19f0558f89.tar.bz2 | |
Merge pull request #2259 from tomchristie/testclient-logout-also-cancels-force-authenticate
`Client.logout()` also clears any `force_authenticate`
Diffstat (limited to 'rest_framework/test.py')
| -rw-r--r-- | rest_framework/test.py | 5 | 
1 files changed, 5 insertions, 0 deletions
| diff --git a/rest_framework/test.py b/rest_framework/test.py index 74d2c868..4f4b7c20 100644 --- a/rest_framework/test.py +++ b/rest_framework/test.py @@ -204,6 +204,11 @@ class APIClient(APIRequestFactory, DjangoClient):      def logout(self):          self._credentials = {} + +        # Also clear any `force_authenticate` +        self.handler._force_user = None +        self.handler._force_token = None +          return super(APIClient, self).logout() | 
