def setUp(self): self.dash = create_app('testing') self.app_context = self.dash.app_context() self.app_context.push() self.app_test_client = self.dash.test_client() db.create_all() # create user for testing u = User(email="*****@*****.**", username="******", full_name="Dash Stack", password="******", avatar="/static/img/user2-160x160.jpg", created_at=datetime.datetime.now()) db.session.add(u)
#coding: utf-8 from dash import create_app if __name__ == '__main__': app = create_app() app.run()
def setUp(self): self.dash = create_app('testing') self.app_context = self.dash.app_context() self.app_context.push() db.create_all()