aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_testing.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_testing.py')
-rw-r--r--tests/test_testing.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_testing.py b/tests/test_testing.py
index e2e4e217..1b126e00 100644
--- a/tests/test_testing.py
+++ b/tests/test_testing.py
@@ -99,6 +99,17 @@ class TestAPITestClient(TestCase):
self.assertEqual(response.status_code, 403)
self.assertEqual(response.data, expected)
+ def test_can_logout(self):
+ """
+ `logout()` reset stored credentials
+ """
+ self.client.credentials(HTTP_AUTHORIZATION='example')
+ response = self.client.get('/view/')
+ self.assertEqual(response.data['auth'], 'example')
+ self.client.logout()
+ response = self.client.get('/view/')
+ self.assertEqual(response.data['auth'], b'')
+
class TestAPIRequestFactory(TestCase):
def test_csrf_exempt_by_default(self):