示例#1
0
 def setUp(self):
     db.create_all()
     populate(default_data=True)
     # reset login settings in case tests fail
     self.app.config['APP_LOGIN_ENABLED'] = True
     self.app.config['CAS_LOGIN_ENABLED'] = True
     self.app.config['LTI_LOGIN_ENABLED'] = True
示例#2
0
 def setUp(self):
     db.create_all()
     with suppress_stdout():
         populate(default_data=True)
     # reset login settings in case tests fail
     self.app.config['APP_LOGIN_ENABLED'] = True
     self.app.config['CAS_LOGIN_ENABLED'] = True
     self.app.config['LTI_LOGIN_ENABLED'] = True
示例#3
0
def _create_tables():
    db.create_all()

    # add database version table and add current head version
    alembic_cfg = Config("alembic.ini")
    alembic_cfg.attributes['configure_logger'] = False
    command.stamp(alembic_cfg, 'head')

    print('All tables created...')
示例#4
0
def create(default_data=True, sample_data=False):
    """Creates database tables from sqlalchemy models"""
    db.create_all()
    populate(default_data, sample_data)

    # add database version table and add current head version
    alembic_cfg = Config("alembic.ini")
    command.stamp(alembic_cfg, 'head')

    print ('All tables are created and data is loaded.')
示例#5
0
 def setUp(self):
     db.create_all()
     with suppress_stdout():
         populate(default_data=True, sample_data=True)
     self.app.config['DEMO_INSTALLATION'] = True
示例#6
0
 def setUp(self):
     db.create_all()
     with suppress_stdout():
         populate(default_data=True, sample_data=True)
     self.app.config['DEMO_INSTALLATION'] = True