Skip to content

Commit

Permalink
Added support for database cache table in test database.
Browse files Browse the repository at this point in the history
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5766 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
malcolmt committed Jul 26, 2007
1 parent 812583c commit 386a4c6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions django/test/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 386a4c6

Please sign in to comment.