Skip to content

Commit

Permalink
Merge pull request ericholscher#23 from michelts/master
Browse files Browse the repository at this point in the history
Make quicktest command compatible with django 1.3
  • Loading branch information
ericholscher committed Dec 28, 2011
2 parents 062feb9 + fda91f2 commit ea002fa
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions test_utils/test_runners/keep_database.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
from django.test.simple import *
from django.test import TestCase
from django.test.simple import build_test, reorder_suite, build_suite
from django.test.utils import setup_test_environment, teardown_test_environment
from django.test.testcases import connections_support_transactions
from django.db.models import get_app, get_apps
from django.conf import settings
try:
from django.utils import unittest # django's 1.3 copy of unittest2
except ImportError:
import unittest # system fallback
import os

def run_tests(test_labels, verbosity=1, interactive=True, extra_tests=[]):
Expand Down Expand Up @@ -76,7 +85,7 @@ def run_tests(test_labels, verbosity=1, interactive=True, extra_tests=[]):
else:
connection.close()

settings.DATABASES['default']['SUPPORTS_TRANSACTIONS'] = connection.creation._rollback_works()
settings.DATABASES['default']['SUPPORTS_TRANSACTIONS'] = connections_support_transactions()

result = unittest.TextTestRunner(verbosity=verbosity).run(suite)

Expand Down

0 comments on commit ea002fa

Please sign in to comment.