def setUp(self): self.client = app.test_client() app.config['TESTING'] = True connect_to_db(app, 'postgresql:///testdb') db.create_all() test_data()
def setUp(self): self.client = app.test_client() app.config['TESTING'] = True # Connect to test database connect_to_db(app, "postgresql:///testdb") # Create tables and add sample data db.create_all() test_data()
def setUp(self): self.client = app.test_client() app.config['TESTING'] = True # Connect to test database connect_to_db(app, "postgresql:///cals_test") print "Built test db" # Create tables and seed sample data db.create_all() test_data()
def setUp(self): """Run code before each test""" # Get the Flask test client self.client = app.test_client() app.config['TESTING'] = True # Connect to test database connect_to_db(app, "postgresql:///testdb") # Create tables and add sample data db.create_all() test_data()
def setUp(self): """Setup, including starting user session.""" self.client = app.test_client() app.config['TESTING'] = True # Connect to test database connect_to_db(app, "postgresql:///testdb") # Create tables and add sample data db.create_all() test_data() with self.client as c: with c.session_transaction() as session: session["active_session"] = 1
def setUp(self): """Set up env for every test before testing db.""" app.config['TESTING'] = True app.config['SECRET_KEY'] = 'key' self.client = app.test_client() with self.client as c: with c.session_transaction() as session: session['user_id'] = 1 session['user_city'] = "San Francisco" # Connect to test database connect_to_db(app, "postgresql:///testdb") db.create_all() test_data()