summaryrefslogtreecommitdiff
path: root/tests/staticfiles_tests
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2019-02-14 07:04:55 -0800
committerTim Graham <timograham@gmail.com>2019-02-14 10:04:55 -0500
commit76990cbbda5d93fda560c8a5ab019860f7efaab7 (patch)
tree7e299a0eb50001d19d11120b9acb286744779afc /tests/staticfiles_tests
parent21f9d437374ee078ee46e23b64efa3d52ca6f49a (diff)
downloaddjango-76990cbbda5d93fda560c8a5ab019860f7efaab7.tar.gz
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 8c775391b78b2a4a2b57c5e89ed4888f36aada4b.
Diffstat (limited to 'tests/staticfiles_tests')
-rw-r--r--tests/staticfiles_tests/test_liveserver.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/staticfiles_tests/test_liveserver.py b/tests/staticfiles_tests/test_liveserver.py
index 264242bbae..820fa5bc89 100644
--- a/tests/staticfiles_tests/test_liveserver.py
+++ b/tests/staticfiles_tests/test_liveserver.py
@@ -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):