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 load_grant(client_id, code): # pragma: no cover return OAuthGrant.get(client_id, code)