Ejemplo n.º 1
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()
Ejemplo n.º 2
0
    def tearDown(self):
        """After every test..."""

        db.session.close()
        db.reflect()
        db.drop_all()
Ejemplo n.º 3
0
from flask import *
from werkzeug.utils import secure_filename
import os
import re
from model import *
from model import db


app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///baseRotonde.db'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS']= False


db = SQLAlchemy(app)

with app.app_context() :
    db.reflect()
    db.drop_all()