diff --git a/dbtemplates/tests.py b/dbtemplates/tests.py index 32a03ee..8e0d7c2 100644 --- a/dbtemplates/tests.py +++ b/dbtemplates/tests.py @@ -4,6 +4,7 @@ import os import shutil import tempfile +from django.core.cache.backends.base import BaseCache from django.core.management import call_command from django.template import loader, Context from django.test import TestCase @@ -12,6 +13,7 @@ from django.contrib.sites.models import Site from dbtemplates.conf import settings from dbtemplates.models import Template +from dbtemplates.utils.cache import get_cache_backend from dbtemplates.utils.template import get_template_source from dbtemplates.management.commands.sync_templates import (FILES_TO_DATABASE, DATABASE_TO_FILES) @@ -91,3 +93,6 @@ class DbTemplatesTestCase(TestCase): temp_template.close() settings.TEMPLATE_DIRS = old_template_dirs shutil.rmtree(temp_template_dir) + + def test_get_cache(self): + self.assertTrue(isinstance(get_cache_backend(), BaseCache)) diff --git a/dbtemplates/utils/cache.py b/dbtemplates/utils/cache.py index 611a490..65ac768 100644 --- a/dbtemplates/utils/cache.py +++ b/dbtemplates/utils/cache.py @@ -6,7 +6,7 @@ from dbtemplates.conf import settings def get_cache_backend(): - return get_cache(settings.CACHE_BACKEND) + return get_cache(settings.DBTEMPLATES_CACHE_BACKEND) cache = get_cache_backend()