diff --git a/django/test/utils.py b/django/test/utils.py index bb8cce80fd3..e9525b4dd42 100644 --- a/django/test/utils.py +++ b/django/test/utils.py @@ -144,6 +144,10 @@ def create_test_db(verbosity=1, autoclobber=False): management.syncdb(verbosity, interactive=False) + if settings.CACHE_BACKEND.startswith('db://'): + cache_name = settings.CACHE_BACKEND[len('db://'):] + management.createcachetable(cache_name) + # Get a cursor (even though we don't need one yet). This has # the side effect of initializing the test database. cursor = connection.cursor()