Skip to content

Commit af9da5b

Browse files
committed
cleanups
1 parent d152955 commit af9da5b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

config/caches.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33

44

55
class DummyCache(dummy.DummyCache):
6-
def set(self, key, value, timeout=DEFAULT_TIMEOUT, version=None, nx=True):
6+
def set(self, key, value, timeout=DEFAULT_TIMEOUT, version=None, nx=None):
77
super().set(key, value, timeout, version)
8-
return nx
8+
# mimic the behavior of django_redis with setnx, for tests
9+
return True
910

1011

1112
class LocMemCache(locmem.LocMemCache):
12-
def set(self, key, value, timeout=DEFAULT_TIMEOUT, version=None, nx=True):
13+
def set(self, key, value, timeout=DEFAULT_TIMEOUT, version=None, nx=None):
1314
super().set(key, value, timeout, version)
14-
return nx
15+
# mimic the behavior of django_redis with setnx, for tests
16+
return True

0 commit comments

Comments
 (0)