def test_expired_access_token_fails(self):
    self.initialize(scope_names=['verify'])

    access_token = self.create_access_token(self.user, self.client)
    access_token.date_created -= datetime.timedelta(
        seconds=access_token.lifetime)
    access_token.save()

    api_request = self.oauth_client.make_api_request(access_token, {})
    api_endpoint = make_oauth_protected_endpoint('verify')

    api_response = api_endpoint(api_request)
    self.assertEqual(api_response.status_code, 401, api_response)
    self.assertIn('WWW-Authenticate', api_response)
If a request is made with an expired token, the endpoint should respond
dataset/ETHPy150Open Locu/djoauth2/djoauth2/tests/test_endpoint.py/TestOAuthScopeEndpointDecorator.test_expired_access_token_fails