Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed tests that relied on MANAGERS not being empty.

Regression in d056124.
  • Loading branch information...
commit f8a634afa2b5810a7bfc17868ca216d277f0f24b 1 parent 94521f5
@aaugustin aaugustin authored
Showing with 10 additions and 4 deletions.
  1. +10 −4 tests/middleware/tests.py
View
14 tests/middleware/tests.py
@@ -245,7 +245,8 @@ def test_prepend_www_append_slash_slashless_custom_urlconf(self):
# Legacy tests for the 404 error reporting via email (to be removed in 1.8)
@override_settings(IGNORABLE_404_URLS=(re.compile(r'foo'),),
- SEND_BROKEN_LINK_EMAILS=True)
+ SEND_BROKEN_LINK_EMAILS=True,
+ MANAGERS=('PHB@dilbert.com',))
def test_404_error_reporting(self):
request = self._get_request('regular_url/that/does/not/exist')
request.META['HTTP_REFERER'] = '/another/url/'
@@ -257,7 +258,8 @@ def test_404_error_reporting(self):
self.assertIn('Broken', mail.outbox[0].subject)
@override_settings(IGNORABLE_404_URLS=(re.compile(r'foo'),),
- SEND_BROKEN_LINK_EMAILS=True)
+ SEND_BROKEN_LINK_EMAILS=True,
+ MANAGERS=('PHB@dilbert.com',))
def test_404_error_reporting_no_referer(self):
request = self._get_request('regular_url/that/does/not/exist')
with warnings.catch_warnings():
@@ -267,7 +269,8 @@ def test_404_error_reporting_no_referer(self):
self.assertEqual(len(mail.outbox), 0)
@override_settings(IGNORABLE_404_URLS=(re.compile(r'foo'),),
- SEND_BROKEN_LINK_EMAILS=True)
+ SEND_BROKEN_LINK_EMAILS=True,
+ MANAGERS=('PHB@dilbert.com',))
def test_404_error_reporting_ignored_url(self):
request = self._get_request('foo_url/that/does/not/exist/either')
request.META['HTTP_REFERER'] = '/another/url/'
@@ -287,7 +290,10 @@ def test_non_ascii_query_string_does_not_crash(self):
self.assertEqual(response.status_code, 301)
-@override_settings(IGNORABLE_404_URLS=(re.compile(r'foo'),))
+@override_settings(
+ IGNORABLE_404_URLS=(re.compile(r'foo'),),
+ MANAGERS=('PHB@dilbert.com',),
+)
class BrokenLinkEmailsMiddlewareTest(TestCase):
def setUp(self):
Please sign in to comment.
Something went wrong with that request. Please try again.