def setUp(self): bigh.app.config["TESTING"] = True bigh.app.config["DBNAME"] = "bigh_test" # must be created first self.app = bigh.app.test_client() with bigh.app.app_context(): bigh.init_db() self.db_fd, self.data_path = tempfile.mkstemp()
def setUp(self): bigh.app.config['TESTING'] = True bigh.app.config['DBNAME'] = 'bigh_test' # must be created first self.app = bigh.app.test_client() with bigh.app.app_context(): bigh.init_db() self.db_fd, self.data_path = tempfile.mkstemp()
def main(): if len(sys.argv) > 1: if sys.argv[1] == 'initdb': init_db() # initialize database
def tearDown(self): os.unlink(self.data_path) with bigh.app.app_context(): bigh.init_db()