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)
def test_grant_make_key(): client_id = str(uuid4()) code = 'foobar' key = '{}:{}'.format(client_id, code) assert OAuthGrant.make_key(client_id, code) == key
def test_grant_make_key(): client_id = str(uuid4()) code = 'foobar' key = f'{client_id}:{code}' assert OAuthGrant.make_key(client_id, code) == key