Ticket #2916: test.diff
File test.diff, 1.5 KB (added by , 18 years ago) |
---|
-
django/test/simple.py
1 1 import unittest, doctest 2 2 from django.conf import settings 3 from django.core import management4 3 from django.test.utils import setup_test_environment, teardown_test_environment 5 4 from django.test.utils import create_test_db, destroy_test_db 6 5 from django.test.testcases import OutputChecker, DocTestRunner … … 78 77 79 78 old_name = settings.DATABASE_NAME 80 79 create_test_db(verbosity) 81 management.syncdb(verbosity, interactive=False)82 80 unittest.TextTestRunner(verbosity=verbosity).run(suite) 83 81 destroy_test_db(old_name, verbosity) 84 82 -
django/test/utils.py
1 1 import sys, time 2 2 from django.conf import settings 3 3 from django.db import connection, transaction, backend 4 from django.core import management 4 5 from django.dispatch import dispatcher 5 6 from django.test import signals 6 7 from django.template import Template … … 84 85 connection.close() 85 86 settings.DATABASE_NAME = TEST_DATABASE_NAME 86 87 88 management.syncdb(verbosity, interactive=False) 89 87 90 # Get a cursor (even though we don't need one yet). This has 88 91 # the side effect of initializing the test database. 89 92 cursor = connection.cursor()