示例#1
0
def populate(directory=None):
    """ Populate database with fixtures
    """

    if directory is None:
        directory = current_app.config['FIXTURES_DIR']
    with perform(
            name='dbutils populate',
            before='Loading fixtures from directory %s' % directory,
            fail='Error occured while loading fixtures',
    ):
        load_fixtures(directory)
示例#2
0
def populate(directory=None):
    """ Populate database with fixtures
    """

    if directory is None:
        directory = current_app.config['FIXTURES_DIR']
    with perform(
        name='dbutils populate',
        before='Loading fixtures from directory %s' % directory,
        fail='Error occured while loading fixtures',
    ):
        load_fixtures(directory)
示例#3
0
 def create_app(self):
     self.app = app_factory()
     with self.app.app_context():
         db.create_all()
         load_fixtures(self.app.config["FIXTURES_DIR"])
     return self.app
示例#4
0
 def create_app(self):
     self.app = app_factory()
     with self.app.app_context():
         db.create_all()
         load_fixtures(self.app.config['FIXTURES_DIR'])
     return self.app