Removed settings.SEND_BROKEN_LINK_EMAILS per deprecation timeline.

This commit is contained in:
Tim Graham 2014-03-21 07:15:58 -04:00
parent aa93a1890f
commit 11e22129d5
4 changed files with 0 additions and 71 deletions

View file

@ -6,7 +6,6 @@ from io import BytesIO
import random
import re
from unittest import skipIf
import warnings
from django.conf import settings
from django.core import mail
@ -21,7 +20,6 @@ from django.middleware.transaction import TransactionMiddleware
from django.test import TransactionTestCase, TestCase, RequestFactory, override_settings
from django.test.utils import IgnoreDeprecationWarningsMixin
from django.utils import six
from django.utils.deprecation import RemovedInDjango18Warning
from django.utils.encoding import force_str
from django.utils.six.moves import xrange
@ -241,44 +239,6 @@ class CommonMiddlewareTest(TestCase):
self.assertEqual(r.url,
'http://www.testserver/customurlconf/slash/')
# 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,
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/'
with warnings.catch_warnings():
warnings.simplefilter("ignore", RemovedInDjango18Warning)
response = self.client.get(request.path)
CommonMiddleware().process_response(request, response)
self.assertEqual(len(mail.outbox), 1)
self.assertIn('Broken', mail.outbox[0].subject)
@override_settings(IGNORABLE_404_URLS=(re.compile(r'foo'),),
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():
warnings.simplefilter("ignore", RemovedInDjango18Warning)
response = self.client.get(request.path)
CommonMiddleware().process_response(request, response)
self.assertEqual(len(mail.outbox), 0)
@override_settings(IGNORABLE_404_URLS=(re.compile(r'foo'),),
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/'
with warnings.catch_warnings():
warnings.simplefilter("ignore", RemovedInDjango18Warning)
response = self.client.get(request.path)
CommonMiddleware().process_response(request, response)
self.assertEqual(len(mail.outbox), 0)
# Other tests
def test_non_ascii_query_string_does_not_crash(self):