Exemple #1
0
def reset_database():
    log.info('Resetting test database')
    db.drop_all()
    db.create_all()

    # creating testdatabase
    py = Category(name='Python')
    Post(title='Hello Python!', body='Python is pretty cool', category=py)
    p = Post(title='Snakes', body='Ssssssss')
    py.posts.append(p)
    db.session.add(py)

    db.session.commit()
 def tearDown(self):
     db.session.remove()
     db.drop_all()
     self.app_context.pop()
 def tearDown(self):
     db.session.remove()
     db.drop_all()
 def tearDown(self):
     #db.session_remove()
     db.drop_all()
 def tearDown(self):
     #db.session_remove()
     db.drop_all()
Exemple #6
0
def drop_db():
    """Drops data tables."""
    if prompt_bool('Are you sure?'):
        db.drop_all()