mirror of
https://github.com/jazzband/django-constance.git
synced 2026-03-16 22:40:24 +00:00
* Add simple backend * Add test case for simple backend * Add tests for mget backend method * Fix redis mock mget implementation * Make sure memory backend is thread safe * Add docs section for memory backend * Add test usage examples to docs * Update docs for memory backend in testing * Share memory storage between threads
18 lines
473 B
Python
18 lines
473 B
Python
from django.test import TestCase
|
|
|
|
from constance import settings
|
|
|
|
from tests.storage import StorageTestsMixin
|
|
|
|
|
|
class TestMemory(StorageTestsMixin, TestCase):
|
|
|
|
def setUp(self):
|
|
self.old_backend = settings.BACKEND
|
|
settings.BACKEND = 'constance.backends.memory.MemoryBackend'
|
|
super().setUp()
|
|
self.config._backend._storage = {}
|
|
|
|
def tearDown(self):
|
|
self.config._backend._storage = {}
|
|
settings.BACKEND = self.old_backend
|