Did I find the right examples for you? yes no

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

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
        request = self._get_request("/")
        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
        request = self._get_request("/")
        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)
        token.save()

src/d/j/django-swingers-1.1.1/swingers/sauth/tests.py   django-swingers(Download)
        # create some tokens for this application link and user and test that
        # a new request correctly returns these two tokens.
        Token.objects.create(secret="abc123", user=user, link=link)
        Token.objects.create(secret="abc321", user=user, link=link)
 
        # create a token that doesn't belong to our user to ensure that this
        # token is not returned in the list of tokens.
        test = User.objects.get(username='test')
        Token.objects.create(secret="testing", user=test, link=link)
 
        # create a token to delete, and make a valid request to delete it
        Token.objects.create(secret="abc123", user=user, link=link)
 
        data['nonce'] = make_nonce()
        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)
        token.modified = modified