Beispiel #1
0
    def setUp(self):
        app = create_app({
            'SQLALCHEMY_DATABASE_URI': DATABASE,
            'ZERQU_CACHE_TYPE': 'simple',
            'OAUTH_CACHE_TYPE': 'simple',
            'RATE_LIMITER_TYPE': 'cache',
            'SECRET_KEY': 'secret',
        })
        app.testing = True

        register_base(app)

        self._ctx = app.app_context()
        self._ctx.push()

        db.drop_all()
        db.create_all()
        self.app = app
        self.client = app.test_client()
Beispiel #2
0
    def setUp(self):
        app = create_app(
            {
                "SQLALCHEMY_DATABASE_URI": DATABASE,
                "ZERQU_CACHE_TYPE": "simple",
                "OAUTH_CACHE_TYPE": "simple",
                "RATE_LIMITER_TYPE": "cache",
                "SECRET_KEY": "secret",
            }
        )
        app.testing = True
        self._ctx = app.app_context()
        self._ctx.push()

        db.init_app(app)

        db.drop_all()
        db.create_all()

        self.app = app
        self.client = app.test_client()
        self.prepare_data()
Beispiel #3
0
def create_database():
    import fixtures
    with app.app_context():
        db.drop_all()
        db.create_all()
        fixtures.run()
Beispiel #4
0
def create_database():
    import fixtures
    with app.app_context():
        db.drop_all()
        db.create_all()
        fixtures.run()