예제 #1
0
def set_up_db():
    '''Connects to an in-memory SQLite database,
    with the purpose of emptying it and recreating it.'''
    metadata.bind = "sqlite:///:memory:"
    #     metadata.bind.echo = True
    setup_all()
    create_all()
예제 #2
0
def set_up_db():
    '''Connects to an in-memory SQLite database,
    with the purpose of emptying it and recreating it.'''
    metadata.bind = "sqlite:///:memory:"
#     metadata.bind.echo = True
    setup_all()
    create_all()
예제 #3
0
 def clean_up_db():
     metadata.bind = 'sqlite:///simplemmo.sqlite'
     setup_all()
     create_all()
     for u in User.query.all():
         print "Deleting %r" % u
         u.delete()
     session.commit()