1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #35712 -- Prevented Q.check() from leaving the connection in an unusable state.

Co-authored-by: Simon Charette <charette.s@gmail.com>
This commit is contained in:
Alex Fischer
2024-08-28 09:53:40 -06:00
committed by Sarah Boyce
parent 387475c5b2
commit c6a4f853c7
2 changed files with 15 additions and 3 deletions

View File

@@ -1,4 +1,5 @@
from django.core.exceptions import FieldError
from django.db import connection
from django.db.models import (
BooleanField,
Exists,
@@ -327,3 +328,6 @@ class QCheckTests(TestCase):
f"Got a database error calling check() on {q!r}: ",
cm.records[0].getMessage(),
)
# We must leave the connection in a usable state (#35712).
self.assertTrue(connection.is_usable())