File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 20
20
@pytest .fixture
21
21
def patch_herd_settings ():
22
22
default_cache = caches ["default" ]
23
- if not isinstance (default_cache .client , herd .HerdClient ):
23
+ if isinstance (default_cache .client , herd .HerdClient ):
24
+ # destroy cache to force recreation with updated settings
25
+ del caches ["default" ]
26
+ with override_settings (CACHE_HERD_TIMEOUT = 2 ):
27
+ yield
28
+ # destroy cache force recreation with original settings
29
+ del caches ["default" ]
30
+ else :
24
31
yield
25
32
26
- # destroy cache to force recreation with updated settings
27
- del caches ["default" ]
28
- with override_settings (CACHE_HERD_TIMEOUT = 2 ):
29
- yield
30
- # destroy cache force recreation with original settings
31
- del caches ["default" ]
32
-
33
33
34
34
class TestDjangoRedisCache :
35
35
def test_setnx (self , cache : RedisCache ):
You can’t perform that action at this time.
0 commit comments