def setUp(self): # create an app with testing config self.app = create_app('testing') # push context self.app_context = self.app.app_context() self.app_context.push() # create all db db.create_all() # pre-fill db with minimal needed things Role.insert_roles() Language.insert_basic_languages() # werkzeug test client self.client = self.app.test_client(use_cookies=True)
def setUp(self): """Method called before each unit-test""" # create app, set TESTING flag to disable error catching self.app = create_app('testing') # push app context self.app_context = self.app.app_context() self.app_context.push() # create databases, see config.py for testing db settings db.create_all() # pre-fill db with minimal needed things Role.insert_roles() Language.insert_basic_languages() # Werkzeug Client to make requests self.client = self.app.test_client(use_cookies=True)
def setUp(self): """Method called before each unit-test""" # create app, set TESTING flag to disable error catching self.app = create_app('testing') # push app context self.app_context = self.app.app_context() self.app_context.push() # make celery tasks eager # celery emulates the API and behavior of AsyncResult, # except the result is already evaluated. celery.conf.update(CELERY_ALWAYS_EAGER=True) # create databases, see config.py for testing db settings db.create_all() # pre-fill db with minimal needed things Role.insert_roles() Language.insert_basic_languages() User.generate_fake(5)
def initialize(): """Create all databases, initialize migration scripts before deploying.""" from flask_migrate import init db.create_all() init()