MCPcopy
hub / github.com/django/django / caches_setting_for_tests

Function caches_setting_for_tests

tests/cache/tests.py:307–320  ·  view source on GitHub ↗
(base=None, exclude=None, **params)

Source from the content-addressed store, hash-verified

305
306
307def caches_setting_for_tests(base=None, exclude=None, **params):
308 # `base` is used to pull in the memcached config from the original
309 # settings, `exclude` is a set of cache names denoting which
310 # `_caches_setting_base` keys should be omitted. `params` are test specific
311 # overrides and `_caches_settings_base` is the base config for the tests.
312 # This results in the following search order:
313 # params -> _caches_setting_base -> base
314 base = base or {}
315 exclude = exclude or set()
316 setting = {k: base.copy() for k in _caches_setting_base if k not in exclude}
317 for key, cache_params in setting.items():
318 cache_params.update(_caches_setting_base[key])
319 cache_params.update(params)
320 return setting
321
322
323class BaseCacheTests:

Calls 3

copyMethod · 0.45
itemsMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected