1
0
mirror of https://github.com/django/django.git synced 2025-10-25 22:56:12 +00:00

[2.2.x] Fixed #30171 -- Fixed DatabaseError in servers tests.

Made DatabaseWrapper thread sharing logic reentrant. Used a reference
counting like scheme to allow nested uses.

The error appeared after 8c775391b7.
Backport of 76990cbbda from master.
This commit is contained in:
Jon Dufresne
2019-02-14 07:04:55 -08:00
committed by Tim Graham
parent 07b44a251a
commit 37cc6a9dce
7 changed files with 100 additions and 66 deletions

View File

@@ -64,6 +64,9 @@ class StaticLiveServerChecks(LiveServerBase):
# app without having set the required STATIC_URL setting.")
pass
finally:
# Use del to avoid decrementing the database thread sharing count a
# second time.
del cls.server_thread
super().tearDownClass()
def test_test_test(self):