mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Refs #32355 -- Used addClassCleanup() in tests.
Inspired by Adam Johnson talk on DjangoCon Europe 2021.
This commit is contained in:
@@ -1442,13 +1442,9 @@ class SMTPBackendTestsBase(SimpleTestCase):
|
||||
EMAIL_HOST="127.0.0.1",
|
||||
EMAIL_PORT=cls.server.socket.getsockname()[1])
|
||||
cls._settings_override.enable()
|
||||
cls.addClassCleanup(cls._settings_override.disable)
|
||||
cls.server.start()
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
cls._settings_override.disable()
|
||||
cls.server.stop()
|
||||
super().tearDownClass()
|
||||
cls.addClassCleanup(cls.server.stop)
|
||||
|
||||
|
||||
class SMTPBackendTests(BaseEmailBackendTests, SMTPBackendTestsBase):
|
||||
|
||||
Reference in New Issue
Block a user