diff options
author | Claude Paroz <claude@2xlibre.net> | 2016-12-01 11:38:01 +0100 |
---|---|---|
committer | Claude Paroz <claude@2xlibre.net> | 2017-01-18 16:21:28 +0100 |
commit | c716fe87821df00f9f03ecc761c914d1682591a2 (patch) | |
tree | 0436706cdb190acbc76fb5fcf6d66f16e09fafa3 /tests/middleware | |
parent | e63d98b7beb16d1410168a2315cbe04c43c9c80d (diff) | |
download | django-c716fe87821df00f9f03ecc761c914d1682591a2.tar.gz |
Refs #23919 -- Removed six.PY2/PY3 usage
Thanks Tim Graham for the review.
Diffstat (limited to 'tests/middleware')
-rw-r--r-- | tests/middleware/tests.py | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/tests/middleware/tests.py b/tests/middleware/tests.py index 43ea0748a0..3c0d3d81ea 100644 --- a/tests/middleware/tests.py +++ b/tests/middleware/tests.py @@ -2,7 +2,6 @@ import gzip import random import re from io import BytesIO -from unittest import skipIf from django.conf import settings from django.core import mail @@ -401,24 +400,6 @@ class BrokenLinkEmailsMiddlewareTest(SimpleTestCase): 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): - # Such referer strings should not happen, but anyway, if it happens, - # let's not crash - 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) - - @skipIf(six.PY3, "HTTP_USER_AGENT is str type on Python 3") - def test_404_error_nonascii_user_agent(self): - # Such user agent strings should not happen, but anyway, if it happens, - # let's not crash - self.req.META['HTTP_REFERER'] = '/another/url/' - self.req.META['HTTP_USER_AGENT'] = b'\xd0\xbb\xd0\xb8\xff\xff' - BrokenLinkEmailsMiddleware().process_response(self.req, self.resp) - self.assertEqual(len(mail.outbox), 1) - self.assertIn('User agent: \u043b\u0438\ufffd\ufffd\n', mail.outbox[0].body) - def test_custom_request_checker(self): class SubclassedMiddleware(BrokenLinkEmailsMiddleware): ignored_user_agent_patterns = (re.compile(r'Spider.*'), re.compile(r'Robot.*')) |