Author: kkubasik
Date: 2009-07-01 17:27:02 -0500 (Wed, 01 Jul 2009)
New Revision: 11145
Modified:
django/branches/soc2009/test-improvements/
django/branches/soc2009/test-improvements/django/test/windmill_tests.py
django/branches/soc2009/test-improvements/tests/regressiontests/admin_views/tests.py
django/branches/soc2009/test-improvements/tests/runtests.py
Log:
[gsoc2009-testing] Cleanup threads after tests run. Ensure the django admin is
populated before windmill tests start
Property changes on: django/branches/soc2009/test-improvements
___________________________________________________________________
Name: svk:merge
- 23ef3597-c209-482b-90c0-ea6045f15f7f:/local/django-gsoc:10972
23ef3597-c209-482b-90c0-ea6045f15f7f:/local/django/trunk:10927
bcc190cf-cafb-0310-a4f2-bffc1f526a37:/django/trunk:1054
+ 23ef3597-c209-482b-90c0-ea6045f15f7f:/local/django-gsoc:10973
23ef3597-c209-482b-90c0-ea6045f15f7f:/local/django/trunk:10927
bcc190cf-cafb-0310-a4f2-bffc1f526a37:/django/trunk:1054
Modified:
django/branches/soc2009/test-improvements/django/test/windmill_tests.py
===================================================================
--- django/branches/soc2009/test-improvements/django/test/windmill_tests.py
2009-07-01 22:26:51 UTC (rev 11144)
+++ django/branches/soc2009/test-improvements/django/test/windmill_tests.py
2009-07-01 22:27:02 UTC (rev 11145)
@@ -55,18 +55,18 @@
# 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:'):
- from django.db import connection
- print 'Creating test DB'
- db_name = connection.creation.create_test_db(0)
- #call_command('syncdb', 0, 0)
- # Import the fixture data into the test database.
- if hasattr(self, 'fixtures'):
- print 'Loading fixtures.'
- # We have to use this slightly awkward syntax due to the fact
- # that we're using *args and **kwargs together.
- call_command('loaddata', *self.fixtures, **{'verbosity': 0})
+ #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,autoclobber=True)
+ #call_command('syncdb', 0, 0)
+ # Import the fixture data into the test database.
+ if hasattr(self, 'fixtures'):
+ print 'Loading fixtures.'
+ # We have to use this slightly awkward syntax due to the fact
+ # that we're using *args and **kwargs together.
+ call_command('loaddata', *self.fixtures, **{'verbosity': 0})
try:
print "running thread"
Modified:
django/branches/soc2009/test-improvements/tests/regressiontests/admin_views/tests.py
===================================================================
---
django/branches/soc2009/test-improvements/tests/regressiontests/admin_views/tests.py
2009-07-01 22:26:51 UTC (rev 11144)
+++
django/branches/soc2009/test-improvements/tests/regressiontests/admin_views/tests.py
2009-07-01 22:27:02 UTC (rev 11145)
@@ -35,12 +35,12 @@
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):
Modified: django/branches/soc2009/test-improvements/tests/runtests.py
===================================================================
--- django/branches/soc2009/test-improvements/tests/runtests.py 2009-07-01
22:26:51 UTC (rev 11144)
+++ django/branches/soc2009/test-improvements/tests/runtests.py 2009-07-01
22:27:02 UTC (rev 11145)
@@ -274,9 +274,10 @@
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.
global_settings.TEST_URL = 'http://localhost:%d' %
server_container.server_thread.port
@@ -331,6 +332,7 @@
#count = count + 1
#setup_module(tests[count][1])
teardown_module(tests[0][1])
+ server_container.stop_test_server()
# sys.argv = [wmtests[0],]
# bin.cli()
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---