def setUp(self): """Do before every test""" # Get the Flask test client self.client = app.test_client() app.config['TESTING'] = True # Connect to test database connect_to_db(app, 'sqlite:////tmp/test.db') # Create tables and add sample data db.create_all() example_data()
def setUp(self): """Do before every test""" # Get the Flask test client self.client = app.test_client() app.config['TESTING'] = True app.config['WTF_CSRF_ENABLED'] = False self._ctx = app.test_request_context() self._ctx.push() # Connect to test database connect_to_db(app, 'sqlite:////tmp/test.db') # Create tables and add sample data db.create_all() example_data()