diff options
Diffstat (limited to 'tests/admin_utils')
| -rw-r--r-- | tests/admin_utils/models.py | 3 | ||||
| -rw-r--r-- | tests/admin_utils/tests.py | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/tests/admin_utils/models.py b/tests/admin_utils/models.py index e5d2b67887..55810f0b50 100644 --- a/tests/admin_utils/models.py +++ b/tests/admin_utils/models.py @@ -55,6 +55,9 @@ class DBCascade(models.Model): def __str__(self): return str(self.num) + class Meta: + required_db_features = {"supports_on_delete_db_cascade"} + class Event(models.Model): date = models.DateTimeField(auto_now_add=True) diff --git a/tests/admin_utils/tests.py b/tests/admin_utils/tests.py index ce32535c52..81c6f495f8 100644 --- a/tests/admin_utils/tests.py +++ b/tests/admin_utils/tests.py @@ -21,7 +21,7 @@ from django.contrib.auth.models import User from django.contrib.auth.templatetags.auth import render_password_as_hash from django.core.validators import EMPTY_VALUES from django.db import DEFAULT_DB_ALIAS, models -from django.test import SimpleTestCase, TestCase, override_settings +from django.test import SimpleTestCase, TestCase, override_settings, skipUnlessDBFeature from django.test.utils import isolate_apps from django.utils.formats import localize from django.utils.safestring import mark_safe @@ -115,6 +115,7 @@ class NestedObjectsTests(TestCase): n.collect([Vehicle.objects.first()]) +@skipUnlessDBFeature("supports_on_delete_db_cascade") class DBNestedObjectsTests(NestedObjectsTests): """ Exercise NestedObjectsTests but with a model that makes use of DB_CASCADE |
