mirror of
https://github.com/django/django.git
synced 2025-07-05 10:19:20 +00:00
[gsoc2009-testing] Cleanup threads after tests run. Ensure the django admin is populated before windmill tests start
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/test-improvements@11145 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
b1b9d34fa5
commit
772452ccc7
@ -55,11 +55,11 @@ class TestServerThread(threading.Thread):
|
||||
|
||||
# Must do database stuff in this new thread if database in memory.
|
||||
from django.conf import settings
|
||||
if settings.DATABASE_ENGINE == 'sqlite3' \
|
||||
and (not settings.TEST_DATABASE_NAME or settings.TEST_DATABASE_NAME == ':memory:'):
|
||||
#if settings.DATABASE_ENGINE == 'sqlite3' \
|
||||
# and (not settings.TEST_DATABASE_NAME or settings.TEST_DATABASE_NAME == ':memory:'):
|
||||
from django.db import connection
|
||||
print 'Creating test DB'
|
||||
db_name = connection.creation.create_test_db(0)
|
||||
db_name = connection.creation.create_test_db(0,autoclobber=True)
|
||||
#call_command('syncdb', 0, 0)
|
||||
# Import the fixture data into the test database.
|
||||
if hasattr(self, 'fixtures'):
|
||||
|
@ -35,12 +35,12 @@ class AdminViewBasicTest(TestCase):
|
||||
|
||||
def setUp(self):
|
||||
from django.contrib import admin
|
||||
admin.autodiscover()
|
||||
admin.register(TestSection)
|
||||
self.client.login(username='super', password='secret')
|
||||
|
||||
def tearDown(self):
|
||||
from django.contrib import admin
|
||||
admin.autodiscover()
|
||||
admin.unregister(TestSection)
|
||||
self.client.logout()
|
||||
|
||||
def testTrailingSlashRequired(self):
|
||||
|
@ -274,7 +274,8 @@ def django_tests(verbosity, interactive, test_labels):
|
||||
print 'Waiting for threaded server to come online.'
|
||||
started.wait()
|
||||
print 'DB Ready, Server online.'
|
||||
|
||||
from django.contrib import admin
|
||||
admin.autodiscover()
|
||||
|
||||
|
||||
# Set the testing URL based on what available port we get.
|
||||
@ -331,6 +332,7 @@ def django_tests(verbosity, interactive, test_labels):
|
||||
#count = count + 1
|
||||
#setup_module(tests[count][1])
|
||||
teardown_module(tests[0][1])
|
||||
server_container.stop_test_server()
|
||||
# sys.argv = [wmtests[0],]
|
||||
# bin.cli()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user