예제 #1
0
    def setUp(self):
        """Before each test..."""

        # Connect to test db
        connect_to_db(s.app, "postgresql:///testdb", False)

        # Create tables and add sample data
        db.create_all()
        db.session.commit()
        sample_data()
예제 #2
0
    def setUp(self):
        """Before each test..."""

        # Connect to test db
        connect_to_db(s.app, "postgresql:///testdb", False)

        # If we stop a test midway, let's make sure there's nothing in the db
        # on the next start up.
        db.reflect()
        db.drop_all()

        # Create tables and add sample data
        db.create_all()
        db.session.commit()
        sample_data()