diff options
author | Russell Keith-Magee <russell@keith-magee.com> | 2007-02-18 08:07:18 +0000 |
---|---|---|
committer | Russell Keith-Magee <russell@keith-magee.com> | 2007-02-18 08:07:18 +0000 |
commit | fb509ee8d3c67efd28beef2df463b62ef883c17a (patch) | |
tree | 56e8bd04832c7405bc2fc2b7812d7532f0b91f39 /django/test/utils.py | |
parent | 895633a80d04ba95b2efdb3e32ddf560c0693339 (diff) | |
download | django-fb509ee8d3c67efd28beef2df463b62ef883c17a.tar.gz |
Fixed #2916 -- Moved syncdb call out of simple test runner and into create_test_db, to match documentation and simplify testing process for people using other test frameworks. Thanks, remco@diji.biz.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4541 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/test/utils.py')
-rw-r--r-- | django/test/utils.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/django/test/utils.py b/django/test/utils.py index 039a6dd7a2..9939e36fa4 100644 --- a/django/test/utils.py +++ b/django/test/utils.py @@ -1,6 +1,7 @@ import sys, time from django.conf import settings from django.db import connection, transaction, backend +from django.core import management from django.dispatch import dispatcher from django.test import signals from django.template import Template @@ -84,6 +85,8 @@ def create_test_db(verbosity=1, autoclobber=False): connection.close() settings.DATABASE_NAME = TEST_DATABASE_NAME + management.syncdb(verbosity, interactive=False) + # Get a cursor (even though we don't need one yet). This has # the side effect of initializing the test database. cursor = connection.cursor() |