Esempio n. 1
0
def _request_context(*args, **kwargs):
    """Provides a request with redis initialized."""

    with app.test_request_context(*args, **kwargs):
        # Unfortunately, flask does not provide decorated before/after
        # functions in this context, so we have to do this manually.
        g.db = redis_db.open_connection(1)
        load_fixture(get_fixture_path("0010_photos.json"))
        load_fixture(get_fixture_path("0011_photo_albums.json"))
        yield
Esempio n. 2
0
def _open_redis():
    g.db = redis_db.open_connection()