Ticket #2916: test.diff

File test.diff, 1.5 KB (added by remco@…, 20 years ago)

patch

  • django/test/simple.py

     
    11import unittest, doctest
    22from django.conf import settings
    3 from django.core import management
    43from django.test.utils import setup_test_environment, teardown_test_environment
    54from django.test.utils import create_test_db, destroy_test_db
    65from django.test.testcases import OutputChecker, DocTestRunner
    … …  
    7877
    7978    old_name = settings.DATABASE_NAME
    8079    create_test_db(verbosity)
    81     management.syncdb(verbosity, interactive=False)
    8280    unittest.TextTestRunner(verbosity=verbosity).run(suite)
    8381    destroy_test_db(old_name, verbosity)
    8482   
  • django/test/utils.py

     
    11import sys, time
    22from django.conf import settings
    33from django.db import connection, transaction, backend
     4from django.core import management
    45from django.dispatch import dispatcher
    56from django.test import signals
    67from django.template import Template
    … …  
    8485    connection.close()
    8586    settings.DATABASE_NAME = TEST_DATABASE_NAME
    8687
     88    management.syncdb(verbosity, interactive=False)
     89
    8790    # Get a cursor (even though we don't need one yet). This has
    8891    # the side effect of initializing the test database.
    8992    cursor = connection.cursor()
Back to Top