Ejemplo n.º 1
0
def create_db():
    """
    Recreates a local database. You probably should not use this on
    production.
    """
    db.drop_all()
    db.create_all()
    db.session.commit()
Ejemplo n.º 2
0
 def setUpClass(cls):
     """ These run once per Test suite """
     app.debug = False
     # Set up the test database
     if DATABASE_URI:
         app.config['SQLALCHEMY_DATABASE_URI'] = DATABASE_URI
     db.drop_all()  # clean before all tests
     init_db()
Ejemplo n.º 3
0
def database(app):
    '''
    Provides a reference to the temporary database in the app context. Use
    this instance instead of importing db from monolith.db.
    '''
    with app.app_context():
        db.create_all()

        _init_database(db)
        yield db

        db.session.rollback()
        db.drop_all()
        db.session.commit()
Ejemplo n.º 4
0
    def setUpClass(cls):
        """ Run once before all tests """
        api_key = generate_apikey()
        app.config['API_KEY'] = api_key
        app.debug = False
        initialize_logging(logging.INFO)

        # Get API key
        api_key = generate_apikey()
        app.config['API_KEY'] = api_key

        # Set up the test database
        if DATABASE_URI:
            app.config['SQLALCHEMY_DATABASE_URI'] = DATABASE_URI
        db.drop_all()  # clean before all tests
        init_db()
Ejemplo n.º 5
0
 def setUp(self):
     db.drop_all()  # clean up the last tests
     db.create_all()  # create new tables
     self.app = routes.app.test_client()
Ejemplo n.º 6
0
 def setUp(self):
     """ This runs before each test """
     db.drop_all()  # clean up the last tests
     db.create_all()
Ejemplo n.º 7
0
 def tearDown(self):
     """ Runs once after each test case """
     db.session.remove()
     db.drop_all()
Ejemplo n.º 8
0
 def tearDown(self):
     db.session.remove()
     db.drop_all()
     db.get_engine(app).dispose()
Ejemplo n.º 9
0
 def setUp(self):
     """ Runs before each test """
     db.drop_all()  # clean up the last tests
     db.create_all()  # create new tables
     self.app = app.test_client()
Ejemplo n.º 10
0
 def setUp(self):
     """ This runs before each test """
     db.drop_all()  # clean up the last tests
     db.create_all()  # make our sqlalchemy tables
 def tearDown(self):
     db.session.remove()
     db.drop_all()
     db.engine.dispose()
 def setUp(self):
     Order.init_db(app)
     db.drop_all()
     db.create_all()
Ejemplo n.º 13
0
 def setUp(self):
     db.drop_all()
     db.create_all()
Ejemplo n.º 14
0
 def setUp(self):
     """Runs before each test."""
     db.drop_all()  # Clean up the last tests.
     db.create_all()  # Create new tables.
     self.app = service.app.test_client()
Ejemplo n.º 15
0
 def setUp(self):
     db.drop_all()  # clean up the last tests
     db.create_all()  # make our sqlalchemy tables
Ejemplo n.º 16
0
 def setUp(self):
     """ This runs before each test """
     db.drop_all()
     db.create_all()
Ejemplo n.º 17
0
 def setUp(self):
     Order.init_db(app)
     db.drop_all()  # clean up the last tests
     db.create_all()  # make our sqlalchemy tables
Ejemplo n.º 18
0
 def setUp(self):
     """Runs before each test"""
     db.drop_all()
     db.create_all()
     self.app = app.test_client()
Ejemplo n.º 19
0
 def tearDown(self):
     """ This runs after each test """
     db.session.remove()
     db.drop_all()
Ejemplo n.º 20
0
 def setUp(self):
     """ This runs before each test """
     db.drop_all()  # clean the last tests
     db.create_all()  # create new tables
     self.app = app.test_client()
     self.headers = {'X-Api-Key': app.config['API_KEY']}
Ejemplo n.º 21
0
 def tearDown(self):
     db.session.remove()
     db.drop_all()
 def tearDown(self):
     """ Runs after each test """
     db.session.remove()
     db.drop_all()
     db.engine.dispose()