diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-05-07 10:02:14 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-07 10:02:14 +0200 |
| commit | 106e8dc91a76ea62e20acf0a0595f343e154af9b (patch) | |
| tree | 85280a0b0ff757ce5080bb0f251d6012bca46530 /tests/postgres_tests/test_constraints.py | |
| parent | b7f1c0d86d72df51aa2e25da79d99074b751c7e1 (diff) | |
Completed test coverage for ExclusionConstraint.
Dropping exclusion constraints was untested.
Diffstat (limited to 'tests/postgres_tests/test_constraints.py')
| -rw-r--r-- | tests/postgres_tests/test_constraints.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/postgres_tests/test_constraints.py b/tests/postgres_tests/test_constraints.py index 79c24c2d75..55b73778cc 100644 --- a/tests/postgres_tests/test_constraints.py +++ b/tests/postgres_tests/test_constraints.py @@ -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' |
