Exemple #1
0
def db(app):
    """Create database for the tests."""
    _db.app = app
    with app.app_context():
        _db.create_all()

    yield _db

    # Explicitly close DB connection
    _db.session.close()
    _db.drop_all()
Exemple #2
0
def drop_db():
    """Menghapus table"""
    db.drop_all()
Exemple #3
0
def drop_db():
    """Drops the db tables."""
    db.drop_all()
Exemple #4
0
def create_db():
    db.drop_all()
    db.create_all()
    db.session.commit()
 def tearDown(self):
     db.session.remove()
     db.drop_all()
def drop_db():
    """Drops the db tables."""
    db.drop_all()
Exemple #7
0
def delete_db():
    """Drops database."""
    db.drop_all()
 def tearDown(self):
     db.session.remove()
     db.drop_all()
Exemple #9
0
def drop_db():
    """Drops the db tables."""
    click.echo('Dropping database tables...')
    db.drop_all()
Exemple #10
0
def drop_db():
    db.drop_all()
Exemple #11
0
 def tearDown(self):
     db.session.remove()
     db.drop_all(bind='agwallet')
Exemple #12
0
def init_db():
    """ Initialize the database."""
    db.drop_all()
    db.create_all()
    create_users()
Exemple #13
0
from flask_testing import TestCase

from project.server import app, db


class BaseTestCase(TestCase):
    """ Base Tests """
    def create_app(self):
        app.config.from_object('project.server.config.TestingConfig')
        return app

    def setUp(self):
        db.create_all()
        db.session.commit()

    def tearDown(self):
        db.session.remove()


db.drop_all()