Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed settings override in mail regression tests

self.settings_override from test subclasses were overwriting parent
attribute.
  • Loading branch information...
commit ade44b8d402c425ca687f254bbaaf161522e5c04 1 parent f65e412
@claudep claudep authored
Showing with 7 additions and 7 deletions.
  1. +7 −7 tests/regressiontests/mail/tests.py
View
14 tests/regressiontests/mail/tests.py
@@ -500,14 +500,14 @@ class FileBackendTests(BaseEmailBackendTests, TestCase):
email_backend = 'django.core.mail.backends.filebased.EmailBackend'
def setUp(self):
+ super(FileBackendTests, self).setUp()
self.tmp_dir = tempfile.mkdtemp()
self.addCleanup(shutil.rmtree, self.tmp_dir)
- self.settings_override = override_settings(EMAIL_FILE_PATH=self.tmp_dir)
- self.settings_override.enable()
- super(FileBackendTests, self).setUp()
+ self._settings_override = override_settings(EMAIL_FILE_PATH=self.tmp_dir)
+ self._settings_override.enable()
def tearDown(self):
- self.settings_override.disable()
+ self._settings_override.disable()
super(FileBackendTests, self).tearDown()
def flush_mailbox(self):
@@ -644,15 +644,15 @@ class SMTPBackendTests(BaseEmailBackendTests, TestCase):
@classmethod
def setUpClass(cls):
cls.server = FakeSMTPServer(('127.0.0.1', 0), None)
- cls.settings_override = override_settings(
+ cls._settings_override = override_settings(
EMAIL_HOST="127.0.0.1",
EMAIL_PORT=cls.server.socket.getsockname()[1])
- cls.settings_override.enable()
+ cls._settings_override.enable()
cls.server.start()
@classmethod
def tearDownClass(cls):
- cls.settings_override.disable()
+ cls._settings_override.disable()
cls.server.stop()
def setUp(self):
Please sign in to comment.
Something went wrong with that request. Please try again.