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()
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()