Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed some failing tests due to creation of HttpRequest._is_secure() …

…methods in [17209]

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17212 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 6cca104be0ee81f817a1f3cd3d3f7210fa7cc420 1 parent 1b312ed
@adrianholovaty adrianholovaty authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 tests/regressiontests/csrf_tests/tests.py
View
8 tests/regressiontests/csrf_tests/tests.py
@@ -43,7 +43,7 @@ class TestingHttpRequest(HttpRequest):
more easily
"""
def is_secure(self):
- return getattr(self, '_is_secure', False)
+ return getattr(self, '_is_secure_override', False)
class CsrfViewMiddlewareTest(TestCase):
# The csrf token is potentially from an untrusted source, so could have
@@ -259,7 +259,7 @@ def test_https_bad_referer(self):
Test that a POST HTTPS request with a bad referer is rejected
"""
req = self._get_POST_request_with_token()
- req._is_secure = True
+ req._is_secure_override = True
req.META['HTTP_HOST'] = 'www.example.com'
req.META['HTTP_REFERER'] = 'https://www.evil.org/somepage'
req2 = CsrfViewMiddleware().process_view(req, post_form_view, (), {})
@@ -271,7 +271,7 @@ def test_https_good_referer(self):
Test that a POST HTTPS request with a good referer is accepted
"""
req = self._get_POST_request_with_token()
- req._is_secure = True
+ req._is_secure_override = True
req.META['HTTP_HOST'] = 'www.example.com'
req.META['HTTP_REFERER'] = 'https://www.example.com/somepage'
req2 = CsrfViewMiddleware().process_view(req, post_form_view, (), {})
@@ -284,7 +284,7 @@ def test_https_good_referer_2(self):
"""
# See ticket #15617
req = self._get_POST_request_with_token()
- req._is_secure = True
+ req._is_secure_override = True
req.META['HTTP_HOST'] = 'www.example.com'
req.META['HTTP_REFERER'] = 'https://www.example.com'
req2 = CsrfViewMiddleware().process_view(req, post_form_view, (), {})
Please sign in to comment.
Something went wrong with that request. Please try again.