mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Fixed #30593 -- Added support for check constraints on MariaDB 10.2+.
This commit is contained in:
parent
7f612eda80
commit
1fc2c70f76
8 changed files with 66 additions and 7 deletions
|
@ -73,7 +73,7 @@ class CheckConstraintTests(TestCase):
|
|||
with self.assertRaises(IntegrityError):
|
||||
Product.objects.create(name='Invalid', price=10, discounted_price=20)
|
||||
|
||||
@skipUnlessDBFeature('supports_table_check_constraints')
|
||||
@skipUnlessDBFeature('supports_table_check_constraints', 'can_introspect_check_constraints')
|
||||
def test_name(self):
|
||||
constraints = get_constraints(Product._meta.db_table)
|
||||
for expected_name in (
|
||||
|
@ -83,7 +83,7 @@ class CheckConstraintTests(TestCase):
|
|||
with self.subTest(expected_name):
|
||||
self.assertIn(expected_name, constraints)
|
||||
|
||||
@skipUnlessDBFeature('supports_table_check_constraints')
|
||||
@skipUnlessDBFeature('supports_table_check_constraints', 'can_introspect_check_constraints')
|
||||
def test_abstract_name(self):
|
||||
constraints = get_constraints(ChildModel._meta.db_table)
|
||||
self.assertIn('constraints_childmodel_adult', constraints)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue