<s> from . base import TestCase <EOL> from . base import create_server , sqlalchemy_provider , cache_provider <EOL> from . base import db , Client , User <EOL> class TestDefaultProvider ( TestCase ) : <EOL> def create_server ( self ) : <EOL> create_server ( self . app ) <EOL> def prepare_data ( self ) : <EOL> self . create_server ( ) <EOL> oauth_client = Client ( <EOL> name = '<STR_LIT>' , client_id = '<STR_LIT>' , client_secret = '<STR_LIT>' , <EOL> _redirect_uris = '<STR_LIT>' , <EOL> ) <EOL> db . session . add ( User ( username = '<STR_LIT:foo>' ) ) <EOL> db . session . add ( oauth_client ) <EOL> db . session . commit ( ) <EOL> self . oauth_client = oauth_client <EOL> def test_get_token ( self ) : <EOL> rv = self . client . post ( '<STR_LIT>' , data = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : self . oauth_client . client_id , <EOL> '<STR_LIT>' : self . oauth_client . client_secret , <EOL> } ) <EOL> assert b'<STR_LIT>' in rv . data <EOL> class TestSQLAlchemyProvider ( TestDefaultProvider ) : <EOL> def create_server ( self ) : <EOL> create_server ( self . app , sqlalchemy_provider ( self . app ) ) <EOL> class TestCacheProvider ( TestDefaultProvider ) : <EOL> def create_server ( self ) : <EOL> create_server ( self . app , cache_provider ( self . app ) ) </s>
