Exemplo n.º 1
0
def frontend_app():
    """Set up global front-end app for functional tests

    Initialized once per test-run
    """
    app = create_frontend_app(config.TESTING_CONF_PATH)
    with app.app_context():
        setup_app(app)
        setup_db()
        yield app
        teardown_db()
Exemplo n.º 2
0
def db(app):
    """Creates clean database schema and drops it on teardown

    Note, that this is a session scoped fixture, it will be executed only once
    and shared among all tests. Use `db_session` fixture to get clean database
    before each test.
    """

    setup_db(app)
    yield database.db
    teardown_db()
Exemplo n.º 3
0
def db_schema(app):
    """Creates clean database schema and drops it on teardown

    Note, that this is a session scoped fixture, it will be executed only once
    and shared among all tests. Use `db` fixture to get clean database before
    each test.
    """
    with app.app_context():
        setup_db()
        yield model.db.session
        teardown_db()
Exemplo n.º 4
0
def database(application):
    """Creates clean database schema and drops it on teardown

    Note, that this is a session scoped fixture, it will be executed only once
    and shared among all tests. Use `db` fixture to get clean database before
    each test.
    """
    assert isinstance(application, App)

    setup_db(application)
    yield db
    teardown_db()
Exemplo n.º 5
0
def db(app):
    """Creates clean database schema and drops it on teardown

    Note, that this is a session scoped fixture, it will be executed only once
    and shared among all tests. Use `db_session` fixture to get clean database
    before each test.
    """
    assert isinstance(app, SkyLines)

    setup_db(app)
    yield database.db
    teardown_db()
Exemplo n.º 6
0
def setup():
    # Setup the database
    setup_db()
    db.session.add(TestTable(name='John Doe', uni='Jane and John Doe'))
    db.session.commit()
Exemplo n.º 7
0
 def setup_method(self):
     tests.setup_db()
Exemplo n.º 8
0
def db(app):
    """Creates clean database schema and drops it on teardown"""
    assert isinstance(app, URLShortenerApp)
    setup_db(app)
    yield database.db
    teardown_db()
Exemplo n.º 9
0
 def setUp(self):
     setup_db(self)
Exemplo n.º 10
0
def setup_db():
	global dbmanager
	tests.setup_db()
	dbmanager = tests.dbmanager
	qbicpwresetd.db_manager = tests.dbmanager
Exemplo n.º 11
0
def setup():
    """Function called by nose on module load"""
    setup_db()
Exemplo n.º 12
0
def setup_db():
	global dbmanager
	tests.setup_db()
	dbmanager = tests.dbmanager