"""Provides a connection method for django-constance to use fake-redis"""

from django.conf import settings

from mtp.apps.common.tests.fake_redis import FakeRedis


def get_redis_connection():
    """Get a fake redis connection to be used in tests by the redis backend of django-constance"""

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