mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Used NotSupportedError instead of DatabaseError in SQLCompiler.as_sql().
This commit is contained in:
committed by
Tim Graham
parent
d825ac6dfa
commit
054a44d6f0
@@ -137,7 +137,7 @@ class SelectForUpdateTests(TransactionTestCase):
|
||||
DatabaseError is raised if a SELECT...FOR UPDATE NOWAIT is run on
|
||||
a database backend that supports FOR UPDATE but not NOWAIT.
|
||||
"""
|
||||
with self.assertRaisesMessage(DatabaseError, 'NOWAIT is not supported on this database backend.'):
|
||||
with self.assertRaisesMessage(NotSupportedError, 'NOWAIT is not supported on this database backend.'):
|
||||
with transaction.atomic():
|
||||
Person.objects.select_for_update(nowait=True).get()
|
||||
|
||||
@@ -148,7 +148,7 @@ class SelectForUpdateTests(TransactionTestCase):
|
||||
DatabaseError is raised if a SELECT...FOR UPDATE SKIP LOCKED is run on
|
||||
a database backend that supports FOR UPDATE but not SKIP LOCKED.
|
||||
"""
|
||||
with self.assertRaisesMessage(DatabaseError, 'SKIP LOCKED is not supported on this database backend.'):
|
||||
with self.assertRaisesMessage(NotSupportedError, 'SKIP LOCKED is not supported on this database backend.'):
|
||||
with transaction.atomic():
|
||||
Person.objects.select_for_update(skip_locked=True).get()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user