|
@@ -22,7 +22,7 @@ from django.test.utils import override_settings
|
|
|
from django.utils import six
|
|
|
from django.utils.encoding import force_str
|
|
|
from django.utils.six.moves import xrange
|
|
|
-from django.utils.unittest import expectedFailure
|
|
|
+from django.utils.unittest import expectedFailure, skipIf
|
|
|
|
|
|
from transactions.tests import IgnorePendingDeprecationWarningsMixin
|
|
|
|
|
@@ -320,6 +320,14 @@ class BrokenLinkEmailsMiddlewareTest(TestCase):
|
|
|
BrokenLinkEmailsMiddleware().process_response(self.req, self.resp)
|
|
|
self.assertEqual(len(mail.outbox), 0)
|
|
|
|
|
|
+ @skipIf(six.PY3, "HTTP_REFERER is str type on Python 3")
|
|
|
+ def test_404_error_nonascii_referrer(self):
|
|
|
+
|
|
|
+
|
|
|
+ self.req.META['HTTP_REFERER'] = b'http://testserver/c/\xd0\xbb\xd0\xb8/'
|
|
|
+ BrokenLinkEmailsMiddleware().process_response(self.req, self.resp)
|
|
|
+ self.assertEqual(len(mail.outbox), 1)
|
|
|
+
|
|
|
|
|
|
class ConditionalGetMiddlewareTest(TestCase):
|
|
|
urls = 'middleware.cond_get_urls'
|