Skip to content

Commit

Permalink
Add SQLAlchemy to test app
Browse files Browse the repository at this point in the history
  • Loading branch information
mgood committed Dec 31, 2013
1 parent b08fe47 commit ffbdf0f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -3,3 +3,4 @@
build/
dist/
docs/_build
.tox
13 changes: 13 additions & 0 deletions test/basic_app.py
@@ -1,5 +1,6 @@
from flask import Flask, render_template
from flask_debugtoolbar import DebugToolbarExtension
from flask_sqlalchemy import SQLAlchemy

app = Flask('basic_app')
app.debug = True
Expand All @@ -10,8 +11,20 @@
app.config['UNICODE_VALUE'] = u'\uffff'

toolbar = DebugToolbarExtension(app)
db = SQLAlchemy(app)


class Foo(db.Model):
__tablename__ = 'foo'
id = db.Column(db.Integer, primary_key=True)


@app.route('/')
def index():
db.create_all()
Foo.query.filter_by(id=1).all()
return render_template('basic_app.html')


if __name__ == '__main__':
app.run()
1 change: 1 addition & 0 deletions tox.ini
Expand Up @@ -4,5 +4,6 @@ envlist = py26,py27,py33
[testenv]
deps =
pytest
Flask-SQLAlchemy
commands =
py.test

0 comments on commit ffbdf0f

Please sign in to comment.