Merge branch 'master' into module-support

This commit is contained in:
Armin Ronacher 2010-05-03 20:00:42 +02:00
commit 9da5795d79
3 changed files with 6 additions and 7 deletions

View file

@ -25,7 +25,7 @@ Here the example `database.py` module for your application::
from sqlalchemy.orm import scoped_session, sessionmaker from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.ext.declarative import declarative_base
engine = create_engine('sqlite:////tmp/test.db') engine = create_engine('sqlite:////tmp/test.db', convert_unicode=True)
db_session = scoped_session(sessionmaker(autocommit=False, db_session = scoped_session(sessionmaker(autocommit=False,
autoflush=False, autoflush=False,
bind=engine)) bind=engine))
@ -104,7 +104,7 @@ Here is an example `database.py` module for your application::
from sqlalchemy import create_engine, MetaData from sqlalchemy import create_engine, MetaData
from sqlalchemy.orm import scoped_session, sessionmaker from sqlalchemy.orm import scoped_session, sessionmaker
engine = create_engine('sqlite:////tmp/test.db') engine = create_engine('sqlite:////tmp/test.db', convert_unicode=True)
metadata = MetaData() metadata = MetaData()
db_session = scoped_session(sessionmaker(autocommit=False, db_session = scoped_session(sessionmaker(autocommit=False,
autoflush=False, autoflush=False,
@ -156,7 +156,7 @@ you basically only need the engine::
from sqlalchemy import create_engine, MetaData from sqlalchemy import create_engine, MetaData
engine = create_engine('sqlite:////tmp/test.db') engine = create_engine('sqlite:////tmp/test.db', convert_unicode=True)
metadata = MetaData(bind=engine) metadata = MetaData(bind=engine)
Then you can either declare the tables in your code like in the examples Then you can either declare the tables in your code like in the examples

View file

@ -12,7 +12,6 @@
from __future__ import with_statement from __future__ import with_statement
import os import os
import sys import sys
import types
from datetime import datetime, timedelta from datetime import datetime, timedelta
from itertools import chain from itertools import chain

View file

@ -255,17 +255,17 @@ class BasicFunctionalityTestCase(unittest.TestCase):
== '/static/index.html' == '/static/index.html'
def test_none_response(self): def test_none_response(self):
warnings.filterwarnings('error', 'View function did not return')
app = flask.Flask(__name__) app = flask.Flask(__name__)
@app.route('/') @app.route('/')
def test(): def test():
return None return None
try: try:
app.test_client().get('/') app.test_client().get('/')
except Warning: except ValueError, e:
assert str(e) == 'View function did not return a response'
pass pass
else: else:
assert "Expected warning" assert "Expected ValueError"
class JSONTestCase(unittest.TestCase): class JSONTestCase(unittest.TestCase):