Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #20603 -- Made the test suite faster.

By avoiding to run syncdb with the full set of test models.

Thanks Anssi for the idea.
  • Loading branch information...
commit c3df86661955f218de4788a57338bb23428f5525 1 parent f656757
Aymeric Augustin authored
6  tests/multiple_database/tests.py
@@ -1943,6 +1943,12 @@ def allow_syncdb(self, db, model):
1943 1943
 
1944 1944
 
1945 1945
 class SyncDBTestCase(TestCase):
  1946
+
  1947
+    available_apps  = [
  1948
+        'multiple_database',
  1949
+        'django.contrib.auth',
  1950
+        'django.contrib.contenttypes'
  1951
+    ]
1946 1952
     multi_db = True
1947 1953
 
1948 1954
     def test_syncdb_to_other_database(self):
7  tests/swappable_models/tests.py
@@ -13,6 +13,13 @@
13 13
 
14 14
 
15 15
 class SwappableModelTests(TestCase):
  16
+
  17
+    available_apps = [
  18
+        'swappable_models',
  19
+        'django.contrib.auth',
  20
+        'django.contrib.contenttypes',
  21
+    ]
  22
+
16 23
     def setUp(self):
17 24
         # This test modifies the installed apps, so we need to make sure
18 25
         # we're not dealing with a cached app list.
5  tests/syncdb_signals/tests.py
@@ -55,6 +55,11 @@ def __call__(self, signal, sender, **kwargs):
55 55
 
56 56
 
57 57
 class SyncdbSignalTests(TestCase):
  58
+
  59
+    available_apps = [
  60
+        'syncdb_signals',
  61
+    ]
  62
+
58 63
     def test_pre_syncdb_call_time(self):
59 64
         self.assertEqual(pre_syncdb_receiver.call_counter, 1)
60 65
 
6  tests/test_runner/tests.py
@@ -9,7 +9,7 @@
9 9
 from django.core.exceptions import ImproperlyConfigured
10 10
 from django.core.management import call_command
11 11
 from django import db
12  
-from django.test import runner, TransactionTestCase, skipUnlessDBFeature
  12
+from django.test import runner, TestCase, TransactionTestCase, skipUnlessDBFeature
13 13
 from django.test.testcases import connections_support_transactions
14 14
 from django.test.utils import IgnorePendingDeprecationWarningsMixin
15 15
 from django.utils import unittest
@@ -240,7 +240,9 @@ def test_import_error(self):
240 240
         self.assertRaises(ImportError, get_tests, module)
241 241
 
242 242
 
243  
-class Sqlite3InMemoryTestDbs(unittest.TestCase):
  243
+class Sqlite3InMemoryTestDbs(TestCase):
  244
+
  245
+    available_apps = []
244 246
 
245 247
     @unittest.skipUnless(all(db.connections[conn].vendor == 'sqlite' for conn in db.connections),
246 248
                          "This is a sqlite-specific issue")

0 notes on commit c3df866

Please sign in to comment.
Something went wrong with that request. Please try again.