diff options
| author | Simon Charette <charette.s@gmail.com> | 2018-12-07 19:55:47 -0500 |
|---|---|---|
| committer | Simon Charette <charette.s@gmail.com> | 2018-12-17 10:01:35 -0500 |
| commit | 7cf9d15cf80df4ed9a1179bc457ff2d03b5e5cb3 (patch) | |
| tree | 986b4ebe928047d827867cc22e7a70f141fa828e /tests/test_runner/tests.py | |
| parent | 8d741bd88fa6bd14327f6fa791017d0773b41cf2 (diff) | |
[2.1.x] Fixed #30023 -- Prevented SQLite schema alterations while foreign key checks are enabled.
Prior to this change foreign key constraint references could be left pointing
at tables dropped during operations simulating unsupported table alterations
because of an unexpected failure to disable foreign key constraint checks.
SQLite3 does not allow disabling such checks while in a transaction so they
must be disabled beforehand.
Thanks ezaquarii for the report and Carlton and Tim for the review.
Backport of 315357ad25a6590e7f4564ec2e56a22132b09001 from master.
Diffstat (limited to 'tests/test_runner/tests.py')
| -rw-r--r-- | tests/test_runner/tests.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/test_runner/tests.py b/tests/test_runner/tests.py index 708a7c2da7..c20f136b20 100644 --- a/tests/test_runner/tests.py +++ b/tests/test_runner/tests.py @@ -10,6 +10,7 @@ from django import db from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.management import call_command +from django.core.management.base import SystemCheckError from django.test import ( TestCase, TransactionTestCase, skipUnlessDBFeature, testcases, ) @@ -201,8 +202,9 @@ class Ticket17477RegressionTests(AdminScriptTestCase): self.assertNoOutput(err) -class Sqlite3InMemoryTestDbs(TestCase): +class Sqlite3InMemoryTestDbs(TransactionTestCase): multi_db = True + available_apps = ['test_runner'] @unittest.skipUnless(all(db.connections[conn].vendor == 'sqlite' for conn in db.connections), "This is an sqlite-specific issue") |
