def setUpClass(cls): cls.db_setup_cls() # creates an app object, which is used to run queries from debsources.app import app_wrapper # erases a few configuration parameters needed for testing: uri = "postgresql:///" + TEST_DB_NAME app_wrapper.app.config["SQLALCHEMY_DATABASE_URI"] = uri app_wrapper.app.config['LIST_OFFSET'] = 5 app_wrapper.app.testing = True app_wrapper.go() cls.app = app_wrapper.app.test_client() cls.app_wrapper = app_wrapper
def setUpClass(cls): # We use the class method here. setUpClass is called at the class # creation, and tearDownClass at the class destruction (instead of # setUp and tearDown before and after each test). This is doable here # because the app never modifies the db (so it's useless to # create/destroy it many times), and this a big gain of time. cls.db_setup_cls() # creates an app object, which is used to run queries from debsources.app import app_wrapper # erases a few configuration parameters needed for testing: uri = "postgresql:///" + TEST_DB_NAME app_wrapper.app.config["DB_URI"] = uri app_wrapper.app.config['LIST_OFFSET'] = 5 app_wrapper.app.testing = True app_wrapper.go() cls.app = app_wrapper.app.test_client() cls.app_wrapper = app_wrapper