from redis_cache.cache import RedisCache

from django.conf import settings

from .fake_redis import FakeRedis


class FakeRedisCache(RedisCache):

    def _init(self, server, params):
        """Use a fake-redis server."""
        super()._init(server, params)

        self._client = FakeRedis(
            host=settings.CACHE_REDIS_HOST,
            port=settings.CACHE_REDIS_PORT,
            db=settings.CACHE_REDIS_DB,
        )
