Fixed flask tests

This commit is contained in:
Armin Ronacher 2014-05-02 11:46:04 +01:00
parent e059bf311c
commit d2d8e66130
5 changed files with 23 additions and 10 deletions

View file

@ -37,13 +37,18 @@ def connect_db():
return rv
@app.cli.command()
def initdb():
"""Creates the database tables."""
def init_db():
"""Initializes the database."""
db = get_db()
with app.open_resource('schema.sql', mode='r') as f:
db.cursor().executescript(f.read())
db.commit()
@app.cli.command('initdb')
def initdb_command():
"""Creates the database tables."""
init_db()
print('Initialized the database.')