Fixed #20603 -- Made the test suite faster.
By avoiding to run syncdb with the full set of test models. Thanks Anssi for the idea.
This commit is contained in:
parent
f656757888
commit
c3df866619
|
@ -1943,6 +1943,12 @@ class SyncOnlyDefaultDatabaseRouter(object):
|
||||||
|
|
||||||
|
|
||||||
class SyncDBTestCase(TestCase):
|
class SyncDBTestCase(TestCase):
|
||||||
|
|
||||||
|
available_apps = [
|
||||||
|
'multiple_database',
|
||||||
|
'django.contrib.auth',
|
||||||
|
'django.contrib.contenttypes'
|
||||||
|
]
|
||||||
multi_db = True
|
multi_db = True
|
||||||
|
|
||||||
def test_syncdb_to_other_database(self):
|
def test_syncdb_to_other_database(self):
|
||||||
|
|
|
@ -13,6 +13,13 @@ from swappable_models.models import Article
|
||||||
|
|
||||||
|
|
||||||
class SwappableModelTests(TestCase):
|
class SwappableModelTests(TestCase):
|
||||||
|
|
||||||
|
available_apps = [
|
||||||
|
'swappable_models',
|
||||||
|
'django.contrib.auth',
|
||||||
|
'django.contrib.contenttypes',
|
||||||
|
]
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
# This test modifies the installed apps, so we need to make sure
|
# This test modifies the installed apps, so we need to make sure
|
||||||
# we're not dealing with a cached app list.
|
# we're not dealing with a cached app list.
|
||||||
|
|
|
@ -55,6 +55,11 @@ signals.pre_syncdb.connect(pre_syncdb_receiver, sender=models)
|
||||||
|
|
||||||
|
|
||||||
class SyncdbSignalTests(TestCase):
|
class SyncdbSignalTests(TestCase):
|
||||||
|
|
||||||
|
available_apps = [
|
||||||
|
'syncdb_signals',
|
||||||
|
]
|
||||||
|
|
||||||
def test_pre_syncdb_call_time(self):
|
def test_pre_syncdb_call_time(self):
|
||||||
self.assertEqual(pre_syncdb_receiver.call_counter, 1)
|
self.assertEqual(pre_syncdb_receiver.call_counter, 1)
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ from optparse import make_option
|
||||||
from django.core.exceptions import ImproperlyConfigured
|
from django.core.exceptions import ImproperlyConfigured
|
||||||
from django.core.management import call_command
|
from django.core.management import call_command
|
||||||
from django import db
|
from django import db
|
||||||
from django.test import runner, TransactionTestCase, skipUnlessDBFeature
|
from django.test import runner, TestCase, TransactionTestCase, skipUnlessDBFeature
|
||||||
from django.test.testcases import connections_support_transactions
|
from django.test.testcases import connections_support_transactions
|
||||||
from django.test.utils import IgnorePendingDeprecationWarningsMixin
|
from django.test.utils import IgnorePendingDeprecationWarningsMixin
|
||||||
from django.utils import unittest
|
from django.utils import unittest
|
||||||
|
@ -240,7 +240,9 @@ class ModulesTestsPackages(IgnorePendingDeprecationWarningsMixin, unittest.TestC
|
||||||
self.assertRaises(ImportError, get_tests, module)
|
self.assertRaises(ImportError, get_tests, module)
|
||||||
|
|
||||||
|
|
||||||
class Sqlite3InMemoryTestDbs(unittest.TestCase):
|
class Sqlite3InMemoryTestDbs(TestCase):
|
||||||
|
|
||||||
|
available_apps = []
|
||||||
|
|
||||||
@unittest.skipUnless(all(db.connections[conn].vendor == 'sqlite' for conn in db.connections),
|
@unittest.skipUnless(all(db.connections[conn].vendor == 'sqlite' for conn in db.connections),
|
||||||
"This is a sqlite-specific issue")
|
"This is a sqlite-specific issue")
|
||||||
|
|
Loading…
Reference in New Issue