Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #19172 -- Isolated poisoned_http_host tests from 500 handlers

Thanks bernardofontes for the report.
  • Loading branch information...
commit b774c5993cf80000966ae8f04c985116f98ee5ac 1 parent 4c4d085
Claude Paroz authored October 29, 2012

Showing 1 changed file with 4 additions and 0 deletions. Show diff stats Hide diff stats

  1. 4  django/contrib/auth/tests/views.py
4  django/contrib/auth/tests/views.py
@@ -115,6 +115,8 @@ def test_admin_reset(self):
115 115
         self.assertTrue("http://adminsite.com" in mail.outbox[0].body)
116 116
         self.assertEqual(settings.DEFAULT_FROM_EMAIL, mail.outbox[0].from_email)
117 117
 
  118
+    # Skip any 500 handler action (like sending more mail...)
  119
+    @override_settings(DEBUG_PROPAGATE_EXCEPTIONS=True)
118 120
     def test_poisoned_http_host(self):
119 121
         "Poisoned HTTP_HOST headers can't be used for reset emails"
120 122
         # This attack is based on the way browsers handle URLs. The colon
@@ -131,6 +133,8 @@ def test_poisoned_http_host(self):
131 133
             )
132 134
         self.assertEqual(len(mail.outbox), 0)
133 135
 
  136
+    # Skip any 500 handler action (like sending more mail...)
  137
+    @override_settings(DEBUG_PROPAGATE_EXCEPTIONS=True)
134 138
     def test_poisoned_http_host_admin_site(self):
135 139
         "Poisoned HTTP_HOST headers can't be used for reset emails on admin views"
136 140
         with self.assertRaises(SuspiciousOperation):

0 notes on commit b774c59

Please sign in to comment.
Something went wrong with that request. Please try again.