File tree Expand file tree Collapse file tree 6 files changed +22
-7
lines changed Expand file tree Collapse file tree 6 files changed +22
-7
lines changed Original file line number Diff line number Diff line change 7
7
env :
8
8
- DJANGO_VERSION='>=3.0,<3.1'
9
9
- DJANGO_VERSION='>=3.1,<3.2'
10
+ - DJANGO_VERSION='>=3.2,<4.0'
10
11
# command to run tests
11
12
install : ./install_redis.sh
12
13
script : make test DJANGO_VERSION=$DJANGO_VERSION
Original file line number Diff line number Diff line change 1
1
SHELL := /bin/bash
2
2
3
3
PACKAGE_NAME =redis_cache
4
- DJANGO_VERSION?=> =1.11,<3.2
4
+ DJANGO_VERSION?=> =1.11,<4.0
5
5
6
6
.PHONY : install_requirements
7
7
install_requirements : requirements* .txt
21
21
22
22
.PHONY : test
23
23
test : install_requirements
24
- PYTHONPATH=$(PYTHONPATH ) : django-admin.py test --settings=tests.settings -s
24
+ PYTHONPATH=$(PYTHONPATH ) : django-admin test --settings=tests.settings -s
25
25
26
26
.PHONY : shell
27
27
shell :
28
- PYTHONPATH=$(PYTHONPATH ) : django-admin.py shell --settings=tests.settings
28
+ PYTHONPATH=$(PYTHONPATH ) : django-admin shell --settings=tests.settings
Original file line number Diff line number Diff line change @@ -21,6 +21,10 @@ Docs can be found at http://django-redis-cache.readthedocs.org/en/latest/.
21
21
Changelog
22
22
=========
23
23
24
+ X.Y.Z
25
+ -----
26
+
27
+ * Confirms support for Django 3.2 (no code changes required).
24
28
25
29
3.0.0
26
30
-----
Original file line number Diff line number Diff line change 23
23
"Framework :: Django" ,
24
24
"Framework :: Django :: 3.0" ,
25
25
"Framework :: Django :: 3.1" ,
26
+ "Framework :: Django :: 3.2" ,
26
27
],
27
28
)
Original file line number Diff line number Diff line change 13
13
except ImportError :
14
14
import pickle
15
15
16
+ import django
16
17
from django .core .cache import caches
17
18
from django .core .exceptions import ImproperlyConfigured
18
19
from django .test import TestCase , override_settings
@@ -125,7 +126,12 @@ def setUp(self):
125
126
126
127
def tearDown (self ):
127
128
# clear caches to allow @override_settings(CACHES=...) to work.
128
- caches ._caches .caches = {}
129
+ if django .VERSION < (3 , 2 ):
130
+ caches ._caches .caches = {}
131
+ else :
132
+ for alias in caches :
133
+ if hasattr (caches ._connections , alias ):
134
+ del caches [alias ]
129
135
# Sometimes it will be necessary to skip this method because we need to
130
136
# test default initialization and that may be using a different port
131
137
# than the test redis server.
Original file line number Diff line number Diff line change 1
1
import time
2
2
3
+ import django
3
4
from django .core .cache import caches
4
5
from django .test import TestCase , override_settings
5
6
@@ -36,9 +37,11 @@ def setUp(self):
36
37
pool .reset ()
37
38
38
39
def test_master_client (self ):
39
- # Reset the caches at the beginning of the test.
40
- caches ._caches .caches = {}
41
-
40
+ # Reset the cache at the beginning of the test.
41
+ if django .VERSION < (3 , 2 ):
42
+ del caches ._caches .caches ['default' ]
43
+ else :
44
+ del caches ['default' ]
42
45
cache = self .get_cache ()
43
46
client = cache .master_client
44
47
self .assertEqual (
You can’t perform that action at this time.
0 commit comments