Commit c9485c78 by Tom Christie

Rename to force_authenticate

parent ab799ccc
......@@ -109,7 +109,7 @@ class APIClient(APIRequestFactory, DjangoClient):
"""
self._credentials = kwargs
def authenticate(self, user=None, token=None):
def force_authenticate(self, user=None, token=None):
"""
Forcibly authenticates outgoing requests with the given
user and/or token.
......
......@@ -37,12 +37,12 @@ class CheckTestClient(TestCase):
response = self.client.get('/view/')
self.assertEqual(response.data['auth'], 'example')
def test_authenticate(self):
def test_force_authenticate(self):
"""
Setting `.authenticate()` forcibly authenticates each request.
Setting `.force_authenticate()` forcibly authenticates each request.
"""
user = User.objects.create_user('example', 'example@example.com')
self.client.authenticate(user)
self.client.force_authenticate(user)
response = self.client.get('/view/')
self.assertEqual(response.data['user'], 'example')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment