From 16ef961a221f922468b26921076e58f0c9299373 Mon Sep 17 00:00:00 2001 From: Daniel M Date: Wed, 15 Mar 2023 15:23:19 -0400 Subject: [PATCH] Update doc --- docs/about/changelog.md | 4 ++++ docs/index.md | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/docs/about/changelog.md b/docs/about/changelog.md index c14eece9..4603d75c 100644 --- a/docs/about/changelog.md +++ b/docs/about/changelog.md @@ -1,5 +1,9 @@ ## Next release +## v2.10.0 +### 🐛 Bug Fixes +- Enable testing django-cache using `FakeConnection`. + ## v2.10.0 ### 🚀 Features - All geo commands implemented diff --git a/docs/index.md b/docs/index.md index 54111c0f..a5961f66 100644 --- a/docs/index.md +++ b/docs/index.md @@ -87,6 +87,27 @@ True Fakeredis implements the same interface as `redis-py`, the popular redis client for python, and models the responses of redis 6.x or 7.x. +### Use to test django cache + +Update your cache settings: + +```python +from fakeredis import FakeConnection + +CACHES = { + 'default': { + 'BACKEND': 'django.core.cache.backends.redis.RedisCache', + 'LOCATION': '...', + 'OPTIONS': { + 'connection_class': FakeConnection + } + } +} +``` + +You can use +django [`@override_settings` decorator](https://docs.djangoproject.com/en/4.1/topics/testing/tools/#django.test.override_settings) + ### Use to test django-rq There is a need to override `django_rq.queues.get_redis_connection` with