mirror of
https://github.com/django/django.git
synced 2024-12-22 17:16:24 +00:00
Refs #35364 -- Tested AdminEmailHandler with empty ADMINS.
This commit is contained in:
parent
73b62a2126
commit
b0f2289426
@ -470,6 +470,21 @@ class AdminEmailHandlerTest(SimpleTestCase):
|
||||
self.assertIn('<div id="traceback">', body_html)
|
||||
self.assertNotIn("<form", body_html)
|
||||
|
||||
@override_settings(ADMINS=[])
|
||||
def test_emit_no_admins(self):
|
||||
handler = AdminEmailHandler()
|
||||
record = self.logger.makeRecord(
|
||||
"name",
|
||||
logging.ERROR,
|
||||
"function",
|
||||
"lno",
|
||||
"message",
|
||||
None,
|
||||
None,
|
||||
)
|
||||
handler.emit(record)
|
||||
self.assertEqual(len(mail.outbox), 0)
|
||||
|
||||
|
||||
class SettingsConfigTest(AdminScriptTestCase):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user