Exemple #1
0
def test_db(test_client):
    # Create the database and the database table
    db.create_all()

    yield db  # this is where the testing happens!

    # anything after yield is teardown code
    db.session.rollback()
    db.session.remove()
    db.drop_all()
Exemple #2
0
def drop(env):
    "Drops database tables"
    init_for(env)
    if prompt_bool("Are you sure you want to lose all your data?"):
        db.drop_all()
Exemple #3
0
 def tearDown(self):
     db.session.remove()
     db.drop_all()
Exemple #4
0
 def tearDown(self):
     db.session.remove()
     db.drop_all()