2013-02-22 13:58:41 +00:00
|
|
|
from django.test import TestCase
|
|
|
|
|
|
|
|
|
|
from constance import settings
|
2013-04-12 15:34:48 +00:00
|
|
|
from tests.storage import StorageTestsMixin
|
2013-02-22 13:58:41 +00:00
|
|
|
|
|
|
|
|
|
2014-11-21 15:37:12 +00:00
|
|
|
class TestRedis(StorageTestsMixin, TestCase):
|
2025-10-07 09:25:07 +00:00
|
|
|
_BACKEND = "constance.backends.redisd.RedisBackend"
|
2022-01-06 20:45:11 +00:00
|
|
|
|
2013-02-22 13:58:41 +00:00
|
|
|
def setUp(self):
|
|
|
|
|
self.old_backend = settings.BACKEND
|
2022-01-06 20:45:11 +00:00
|
|
|
settings.BACKEND = self._BACKEND
|
2019-12-23 21:20:41 +00:00
|
|
|
super().setUp()
|
2014-11-21 15:37:12 +00:00
|
|
|
self.config._backend._rd.clear()
|
2013-02-22 13:58:41 +00:00
|
|
|
|
|
|
|
|
def tearDown(self):
|
2014-11-21 15:37:12 +00:00
|
|
|
self.config._backend._rd.clear()
|
2013-02-22 13:58:41 +00:00
|
|
|
settings.BACKEND = self.old_backend
|
2022-01-06 20:45:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class TestCachingRedis(TestRedis):
|
2025-10-07 09:25:07 +00:00
|
|
|
_BACKEND = "constance.backends.redisd.CachingRedisBackend"
|