def app(): app = create_app(test=True) with app.app_context(): db.create_all() yield app with app.app_context(): db.drop_all()
# coding:utf-8 from todos import create_app app = create_app() if __name__ == '__main__': app.run(debug=True)
from todos import db, create_app db.create_all(app=create_app())
def create_app(self): return create_app()
def create_app(self): app = create_app() app.config['LIVESERVER_PORT'] = 8943 return app
def create_app(self): app = create_app() self.twill = Twill(app) return app
def create_app(self): app = create_app() app.config.from_object(self) return app
Generic.Heading: "bold #000080", # class: 'gh' Generic.Inserted: "#00A000", # class: 'gi' Generic.Output: "#888", # class: 'go' Generic.Prompt: "#745334", # class: 'gp' Generic.Strong: "bold #000000", # class: 'gs' Generic.Subheading: "bold #800080", # class: 'gu' Generic.Traceback: "bold #a40000", # class: 'gt' } ########NEW FILE######## __FILENAME__ = run from todos import create_app if __name__ == "__main__": app = create_app() app.run() ########NEW FILE######## __FILENAME__ = tests from twill.browser import TwillException from flask_testing import TestCase, Twill from todos import create_app class TestViews(TestCase): def create_app(self): app = create_app() self.twill = Twill(app) return app