Completed test coverage for ExclusionConstraint.

Dropping exclusion constraints was untested.
This commit is contained in:
Mariusz Felisiak 2020-05-07 10:02:14 +02:00 committed by GitHub
parent b7f1c0d86d
commit 106e8dc91a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -390,6 +390,10 @@ class ExclusionConstraintTests(PostgreSQLTestCase):
RangesModel.objects.create(ints=(10, 20))
RangesModel.objects.create(ints=(10, 19))
RangesModel.objects.create(ints=(51, 60))
# Drop the constraint.
with connection.schema_editor() as editor:
editor.remove_constraint(RangesModel, constraint)
self.assertNotIn(constraint_name, self.get_constraints(RangesModel._meta.db_table))
def test_range_adjacent_initially_deferred(self):
constraint_name = 'ints_adjacent_deferred'