コード例 #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()
コード例 #2
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()
コード例 #3
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()
コード例 #4
0
 def setUp(self):
     """ This runs before each test """
     db.drop_all()  # clean up the last tests
     db.create_all()  # make our sqlalchemy tables
コード例 #5
0
 def setUp(self):
     Order.init_db(app)
     db.drop_all()  # clean up the last tests
     db.create_all()  # make our sqlalchemy tables
コード例 #6
0
 def setUp(self):
     db.drop_all()  # clean up the last tests
     db.create_all()  # make our sqlalchemy tables
コード例 #7
0
 def setUp(self):
     db.drop_all()  # clean up the last tests
     db.create_all()  # create new tables
     self.app = routes.app.test_client()
コード例 #8
0
 def setUp(self):
     """ This runs before each test """
     db.drop_all()  # clean up the last tests
     db.create_all()
コード例 #9
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']}
コード例 #10
0
 def setUp(self):
     """Runs before each test"""
     db.drop_all()
     db.create_all()
     self.app = app.test_client()
コード例 #11
0
 def setUp(self):
     """ This runs before each test """
     db.drop_all()
     db.create_all()
コード例 #12
0
 def setUp(self):
     Order.init_db(app)
     db.drop_all()
     db.create_all()
コード例 #13
0
 def setUp(self):
     db.drop_all()
     db.create_all()
コード例 #14
0
 def setUp(self):
     """ Runs before each test """
     self.headers = {'X-Api-Key': app.config['API_KEY']}
     db.create_all()  # create new tables
     self.app = app.test_client()
     self.headers = {'X-Api-Key': app.config['API_KEY']}
コード例 #15
0
 def setUp(self):
     db.create_all()  # make our sqlalchemy tables
コード例 #16
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()