mirror of
https://github.com/django/django.git
synced 2025-11-25 05:04:26 +00:00
Fixed #21383 -- Added request details in SuspiciousOperation messages
This commit is contained in:
parent
7e714827ea
commit
e6dd70b4db
3 changed files with 17 additions and 3 deletions
|
|
@ -370,3 +370,12 @@ class SecurityLoggerTest(TestCase):
|
|||
self.client.get('/suspicious_spec/')
|
||||
self.assertEqual(len(calls), 1)
|
||||
self.assertEqual(calls[0], 'dubious')
|
||||
|
||||
@override_settings(
|
||||
ADMINS=(('admin', 'admin@example.com'),),
|
||||
DEBUG=False,
|
||||
)
|
||||
def test_suspicious_email_admins(self):
|
||||
self.client.get('/suspicious/')
|
||||
self.assertEqual(len(mail.outbox), 1)
|
||||
self.assertIn('path:/suspicious/,', mail.outbox[0].body)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue