1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Fixed #30593 -- Added support for check constraints on MariaDB 10.2+.

This commit is contained in:
Hasan Ramezani
2019-07-14 01:24:35 +02:00
committed by Mariusz Felisiak
parent 7f612eda80
commit 1fc2c70f76
8 changed files with 66 additions and 7 deletions

View File

@@ -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)