Skip to content

Commit

Permalink
Made OnDeleteTests.test_protect() assert more specific ProtectedError.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixxm committed Jan 27, 2020
1 parent 99640fa commit ca9c2c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/delete/tests.py
@@ -1,6 +1,6 @@
from math import ceil

from django.db import IntegrityError, connection, models
from django.db import connection, models
from django.db.models.deletion import (
Collector, ProtectedError, RestrictedError,
)
Expand Down Expand Up @@ -76,7 +76,7 @@ def test_protect(self):
"Cannot delete some instances of model 'R' because they are "
"referenced through protected foreign keys: 'A.protect'."
)
with self.assertRaisesMessage(IntegrityError, msg):
with self.assertRaisesMessage(ProtectedError, msg):
a.protect.delete()

def test_protect_multiple(self):
Expand Down

0 comments on commit ca9c2c1

Please sign in to comment.