def setUp(self):
    self.test_user = UserModel.objects.create_user('test_user',
        'test@user.com', '123456')
self.application = Application(name='Test Application', redirect_uris=
    'http://localhost', user=self.test_user, client_type=Application.
    CLIENT_CONFIDENTIAL, authorization_grant_type=Application.
    GRANT_AUTHORIZATION_CODE)
self.application.save()

def test_revoke_access_token(self):
    from datetime import datetime
from django.utils import timezone
tok = AccessToken.objects.create(user=self.test_user, token='1234567890',
    application=self.application, scope='read write', expires=timezone.now(
    ) + datetime.timedelta(days=1))
Как протестировать конечную точку API с Django-rest-framework, используя Django-oauth-toolkit для аутентификации