From d482353a932bae0f74c6fc87372a78c604ad6326 Mon Sep 17 00:00:00 2001 From: Mehdy Khoshnoody Date: Tue, 5 Oct 2021 22:26:33 +0330 Subject: [PATCH] Add test to ensure default value for cache works Signed-off-by: Mehdy Khoshnoody --- tests/test_cache.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test_cache.py b/tests/test_cache.py index 42c72bbc..dd4e4626 100644 --- a/tests/test_cache.py +++ b/tests/test_cache.py @@ -226,3 +226,11 @@ def test_cache_url_password_using_gen_delims(monkeypatch, chars): result = env.cache() assert result['BACKEND'] == 'django_redis.cache.RedisCache' assert result['LOCATION'] == url + + +def test_cache_url_env_using_default(): + env = Env(CACHE_URL=(str, "locmemcache://")) + result = env.cache() + + assert result["BACKEND"] == "django.core.cache.backends.locmem.LocMemCache" + assert result["LOCATION"] == ""