1
0
mirror of https://github.com/django/django.git synced 2024-12-23 01:25:58 +00:00

Refs #22343 -- Corrected a test for missing select_for_update(nowait=True) support.

This commit is contained in:
Simon Charette 2016-08-08 12:28:37 -04:00
parent 887f3d3219
commit 29a3f8b4bb
No known key found for this signature in database
GPG Key ID: 72AF89A0B1B4EDB3

View File

@ -132,12 +132,12 @@ class SelectForUpdateTests(TransactionTestCase):
@skipUnlessDBFeature('has_select_for_update') @skipUnlessDBFeature('has_select_for_update')
def test_unsupported_nowait_raises_error(self): def test_unsupported_nowait_raises_error(self):
""" """
If a SELECT...FOR UPDATE NOWAIT is run on a database backend DatabaseError is raised if a SELECT...FOR UPDATE NOWAIT is run on
that supports FOR UPDATE but not NOWAIT, then we should find a database backend that supports FOR UPDATE but not NOWAIT.
that a DatabaseError is raised.
""" """
with self.assertRaises(DatabaseError): with self.assertRaisesMessage(DatabaseError, 'NOWAIT is not supported on this database backend.'):
list(Person.objects.all().select_for_update(nowait=True)) with transaction.atomic():
Person.objects.select_for_update(nowait=True).get()
@skipIfDBFeature('has_select_for_update_skip_locked') @skipIfDBFeature('has_select_for_update_skip_locked')
@skipUnlessDBFeature('has_select_for_update') @skipUnlessDBFeature('has_select_for_update')