Esempio n. 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)
Esempio n. 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)
Esempio n. 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
Esempio n. 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