{{{
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
},
'KEY_PREFIX': "SomeKeyPrefix"
}
}}}
{{{
Traceback (most recent call last):
File "/snap/pycharm-
professional/215/plugins/python/helpers/pycharm/django_test_manage.py",
line 168, in <module>
utility.execute()
File "/snap/pycharm-
professional/215/plugins/python/helpers/pycharm/django_test_manage.py",
line 142, in execute
_create_command().run_from_argv(self.argv)
File "/home/.../lib/python3.8/site-
packages/django/core/management/commands/test.py", line 23, in
run_from_argv
super().run_from_argv(argv)
File "/home/.../DJ3/lib/python3.8/site-
packages/django/core/management/base.py", line 328, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/.../lib/python3.8/site-
packages/django/core/management/base.py", line 369, in execute
output = self.handle(*args, **options)
File "/snap/pycharm-
professional/215/plugins/python/helpers/pycharm/django_test_manage.py",
line 104, in handle
failures = TestRunner(test_labels, **options)
File "/snap/pycharm-
professional/215/plugins/python/helpers/pycharm/django_test_runner.py",
line 254, in run_tests
return DjangoTeamcityTestRunner(**options).run_tests(test_labels,
File "/snap/pycharm-
professional/215/plugins/python/helpers/pycharm/django_test_runner.py",
line 156, in run_tests
return super(DjangoTeamcityTestRunner, self).run_tests(test_labels,
extra_tests, **kwargs)
File "/home/.../lib/python3.8/site-packages/django/test/runner.py", line
684, in run_tests
old_config = self.setup_databases(aliases=databases)
File "/home/.../lib/python3.8/site-packages/django/test/runner.py", line
604, in setup_databases
return _setup_databases(
File "/home/.../lib/python3.8/site-packages/django/test/utils.py", line
169, in setup_databases
connection.creation.create_test_db(
File "/home/.../lib/python3.8/site-
packages/django/db/backends/base/creation.py", line 82, in create_test_db
call_command('createcachetable', database=self.connection.alias)
File "/home/.../lib/python3.8/site-
packages/django/core/management/__init__.py", line 168, in call_command
return command.execute(*args, **defaults)
File "/home/.../lib/python3.8/site-
packages/django/core/management/base.py", line 369, in execute
output = self.handle(*args, **options)
File "/home/.../lib/python3.8/site-
packages/django/core/management/commands/createcachetable.py", line 42, in
handle
cache = caches[cache_alias]
File "/home/.../lib/python3.8/site-
packages/django/core/cache/__init__.py", line 79, in __getitem__
cache = _create_cache(alias)
File "/home/.../lib/python3.8/site-
packages/django/core/cache/__init__.py", line 47, in _create_cache
params = {**conf, **kwargs}
TypeError: 'str' object is not a mapping
}}}
Error message is pretty clear, but likely requires a more general solution
implemented in createcachetable.py when DummyCache backend is being used.
Workaround: Do not add options to DummyCache backend, and potentially
update documentation to indicate if options to DummyCache will be a
problem.
--
Ticket URL: <https://code.djangoproject.com/ticket/32100>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => invalid
Comment:
It's a bug in your settings,
[https://docs.djangoproject.com/en/3.1/ref/settings/#key-prefix
KEY_PREFIX] should be in `'default'`:
{{{
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
'KEY_PREFIX': 'SomeKeyPrefix',
},
}
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/32100#comment:1>
Comment (by Kaustubh Bhalerao):
My bad!! tests work with the correct format.
--
Ticket URL: <https://code.djangoproject.com/ticket/32100#comment:2>