예제 #1
0
파일: common.py 프로젝트: mulchy/openFEC
 def setUpClass(cls):
     super(ApiBaseTest, cls).setUpClass()
     manage.load_districts()
     manage.update_functions()
     rest.db.metadata.create_all(
         rest.db.engine,
         tables=[
             each.__table__ for each in rest.db.Model._decl_class_registry.values()
             if hasattr(each, '__table__')
         ]
     )
예제 #2
0
파일: common.py 프로젝트: yjoshuaz/openFEC
 def setUpClass(cls):
     super(ApiBaseTest, cls).setUpClass()
     manage.load_districts()
     manage.update_functions()
     rest.db.metadata.create_all(
         rest.db.engine,
         tables=[
             each.__table__
             for each in rest.db.Model._decl_class_registry.values()
             if hasattr(each, '__table__')
         ])
예제 #3
0
파일: common.py 프로젝트: neonseri/openFEC
    def setUpClass(cls):
        super(ApiBaseTest, cls).setUpClass()
        manage.load_districts()
        manage.update_functions()
        whitelist = [models.CandidateCommitteeTotalsPresidential, models.CandidateCommitteeTotalsHouseSenate]
        rest.db.metadata.create_all(
            rest.db.engine,
            tables=[
                each.__table__ for each in rest.db.Model._decl_class_registry.values()
                if hasattr(each, '__table__') and each not in whitelist
            ]

        )
예제 #4
0
def refresh():
    """Update incremental aggregates, itemized schedules, materialized views,
    then email logs to the development team.
    """
    buffer = io.StringIO()
    with mail.CaptureLogs(manage.logger, buffer):
        try:
            manage.update_functions()
            manage.update_aggregates()
            manage.refresh_itemized()
            manage.update_itemized('e')
            manage.update_schemas()
            download.clear_bucket()
        except Exception as error:
            manage.logger.exception(error)
    try:
        mail.send_mail(buffer)
    except Exception as error:
        logger.exception(error)
예제 #5
0
파일: common.py 프로젝트: WhitTip/openFEC
 def setUpClass(cls):
     super(ApiBaseTest, cls).setUpClass()
     manage.load_districts()
     manage.update_functions()
     rest.db.create_all()
예제 #6
0
파일: common.py 프로젝트: NoahKunin/openFEC
 def setUpClass(cls):
     super(ApiBaseTest, cls).setUpClass()
     manage.load_districts()
     manage.update_functions()
     rest.db.create_all()