Anton Shestakov <engored@ya.ru>, Fri, 11 Jan 2013 19:10:31 +0900
Use @app.before_first_request instead of calling init_db() explicitly (so autogenerated wsgi.py files will just work).
--- a/app.py Fri Jan 11 17:34:22 2013 +0900
+++ b/app.py Fri Jan 11 19:10:31 2013 +0900
+@app.before_first_request
if __name__ == '__main__':
--- a/test.py Fri Jan 11 17:34:22 2013 +0900
+++ b/test.py Fri Jan 11 19:10:31 2013 +0900
from itertools import chain
from unittest import TestCase, main
-from app import app, init_db
class BaseTestCase(TestCase):
if __name__ == '__main__':
app.config['TESTING'] = True
app.config['DATABASE'] = 'test_db'