Did I find the right examples for you? yes no

All Samples(13)  |  Call(13)  |  Derive(0)  |  Import(0)

src/d/j/django-swingers-1.1.1/swingers/utils/auth.py   django-swingers(Download)
    """
    from swingers.sauth.models import ApplicationLink
    link = ApplicationLink.objects.get(server_name=service)
    url = link.server_url
    access_token = link.get_access_token(request.user.username)
    # Try and find the client_id
    try:
        link = ApplicationLink.objects.get(client_name=data["client_id"],
                                           server_name=settings.SERVICE_NAME)
    except ApplicationLink.DoesNotExist:

src/d/j/django-swingers-1.1.1/swingers/utils/tests.py   django-swingers(Download)
 
        # valid (sha256)
        link = ApplicationLink.objects.get(client_name="test",
                                           server_name=settings.SERVICE_NAME)
        user, l, expires = validate_request(
        # valid (basic)
        with self.settings(SERVICE_NAME="restless2"):
            link = ApplicationLink.objects.get(client_name="test2",
                                               server_name="restless2")
            user, l, expires = validate_request(
        instance = self.requests.return_value
 
        link = ApplicationLink.objects.get(server_name='swingers')
 
        username = request.user.username

src/d/j/django-swingers-1.1.1/swingers/middleware/tests.py   django-swingers(Download)
        """
        user = User.objects.get(pk=1)
        link = ApplicationLink.objects.get(pk=1)
        token = Token.objects.create(secret='sesame', user=user, link=link)
        modified = token.modified
        """
        user = User.objects.get(pk=1)
        link = ApplicationLink.objects.get(pk=1)
        token = Token.objects.create(secret='sesame', user=user, link=link)
        modified = token.modified
        """
        user = User.objects.get(pk=1)
        link = ApplicationLink.objects.get(pk=1)
        token = Token.objects.create(secret='sesame', user=user, link=link)
        token.modified = token.modified - timedelta(seconds=token.timeout)

src/d/j/django-swingers-1.1.1/swingers/sauth/tests.py   django-swingers(Download)
    def test_request_access_token(self):
        """
        Test requesting a token.
        """
        link = ApplicationLink.objects.get(pk=1)
    def test_request_token_basic_auth(self):
        link = ApplicationLink.objects.get(pk=2)
        user = 'admin'
        url = reverse('request_access_token')
        data = {
        url = reverse('list_access_tokens')
        user = User.objects.get(pk=1)
        link = ApplicationLink.objects.get(pk=1)
 
        nonce = make_nonce()
        url = reverse('delete_access_token')
        user = User.objects.get(pk=1)
        link = ApplicationLink.objects.get(pk=1)
 
        # test a request with a missing token secret
        """
        user = User.objects.get(pk=1)
        link = ApplicationLink.objects.get(pk=1)
        token = Token.objects.create(secret='sesame', user=user, link=link)
        modified = token.modified - timedelta(seconds=30)