1
0
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:
Adam Johnson 2024-04-09 14:50:37 +01:00 committed by Sarah Boyce
parent 73b62a2126
commit b0f2289426

View File

@ -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):
"""