Beispiel #1
0
def test_grant_get(mocker):
    mocker.patch.object(OAuthGrant, '_cache')
    client_id = str(uuid4())
    code = 'foobar'
    OAuthGrant.get(client_id, code)
    key = OAuthGrant.make_key(client_id, code)
    OAuthGrant._cache.get.assert_called_with(key)
Beispiel #2
0
def test_grant_get(mocker):
    mocker.patch.object(OAuthGrant, '_cache')
    client_id = str(uuid4())
    code = 'foobar'
    OAuthGrant.get(client_id, code)
    key = OAuthGrant.make_key(client_id, code)
    OAuthGrant._cache.get.assert_called_with(key)
Beispiel #3
0
def test_grant_make_key():
    client_id = str(uuid4())
    code = 'foobar'
    key = '{}:{}'.format(client_id, code)
    assert OAuthGrant.make_key(client_id, code) == key
Beispiel #4
0
def test_grant_make_key():
    client_id = str(uuid4())
    code = 'foobar'
    key = '{}:{}'.format(client_id, code)
    assert OAuthGrant.make_key(client_id, code) == key
Beispiel #5
0
def test_grant_make_key():
    client_id = str(uuid4())
    code = 'foobar'
    key = f'{client_id}:{code}'
    assert OAuthGrant.make_key(client_id, code) == key