summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-07-26 22:59:34 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-07-26 22:59:34 +0000
commit386a4c610c3db14b713d1840baae54372cf0c63e (patch)
tree7a0d0d7c3a7d04f707c5be9fac545134d01438c3
parent812583ce3b49ec871ded8d281a80ac6809f8df44 (diff)
Added support for database cache table in test database.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5766 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/test/utils.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/django/test/utils.py b/django/test/utils.py
index bb8cce80fd..e9525b4dd4 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()