コード例 #1
0
def make_test_app(use_cookies=False):
    app.config['TESTING'] = True
    app.config['CACHE'] = False
    app.config['PLUGINS'] = []
    app.config['CELERY_ALWAYS_EAGER'] = True
    app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///:memory:'
    db.create_all()

    return app.test_client(use_cookies=use_cookies)
コード例 #2
0
ファイル: helpers.py プロジェクト: jmorenoamor/grano
def make_test_app(use_cookies=False):
    app.config['TESTING'] = True
    app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///:memory:'
    #import ipdb; ipdb.set_trace()
    from grano.model import Account
    db.create_all()
    client = app.test_client(use_cookies=use_cookies)
    app.test_user = Account.create(TEST_USER)
    db.session.commit()
    return client
コード例 #3
0
def make_test_app(use_cookies=False):
    app.config['TESTING'] = True
    app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///:memory:'
    #import ipdb; ipdb.set_trace()
    from grano.model import Account
    db.create_all()
    client = app.test_client(use_cookies=use_cookies)
    app.test_user = Account.create(TEST_USER)
    db.session.commit()
    return client
コード例 #4
0
def make_test_app(use_cookies=False):
    """For some reason this does not work when imported from util.
    Error is:
        AttributeError: 'FlaskClient' object has no attribute 'test_request_context'
    """
    app.config['TESTING'] = True
    app.config['CACHE'] = False
    app.config['PLUGINS'] = []
    app.config['CELERY_ALWAYS_EAGER'] = True
    app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///:memory:'
    db.create_all()
    create_fixtures()
    return app
コード例 #5
0
ファイル: test_authz.py プロジェクト: 01-/grano
def make_test_app(use_cookies=False):
    """For some reason this does not work when imported from util.
    Error is:
        AttributeError: 'FlaskClient' object has no attribute 'test_request_context'
    """
    app.config['TESTING'] = True
    app.config['CACHE'] = False
    app.config['PLUGINS'] = []
    app.config['CELERY_ALWAYS_EAGER'] = True
    app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///:memory:'
    db.create_all()
    create_fixtures()
    return app
コード例 #6
0
def createdb():
    """ Create the database schema. """
    db.create_all()
コード例 #7
0
ファイル: manage.py プロジェクト: pudo-attic/grano-old
def createdb():
    """ Create the SQLAlchemy database. """
    db.create_all()
コード例 #8
0
ファイル: manage.py プロジェクト: eocaollai/grano
def createdb():
    """ Create the database schema. """
    db.create_all()
コード例 #9
0
ファイル: manage.py プロジェクト: jmorenoamor/grano
def createdb():
    """ Create the SQLAlchemy database. """
    db.create_all()