From 694deff82f86e025561dfa724425f67e2ff7cbb7 Mon Sep 17 00:00:00 2001 From: Chris Jerdonek Date: Thu, 11 Feb 2021 05:43:36 -0800 Subject: Fixed #32437 -- Fixed cleaning up ALLOWED_HOSTS in LiveServerTestCase on setUpClass() failure. --- django/test/testcases.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'django') diff --git a/django/test/testcases.py b/django/test/testcases.py index d064b47e9b..dfa4f41fb5 100644 --- a/django/test/testcases.py +++ b/django/test/testcases.py @@ -1573,11 +1573,12 @@ class LiveServerTestCase(TransactionTestCase): for conn in cls.server_thread.connections_override.values(): conn.dec_thread_sharing() + cls._live_server_modified_settings.disable() + super().tearDownClass() + @classmethod def tearDownClass(cls): cls._tearDownClassInternal() - cls._live_server_modified_settings.disable() - super().tearDownClass() class SerializeMixin: -- cgit v1.3