From 6cca104be0ee81f817a1f3cd3d3f7210fa7cc420 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Sat, 17 Dec 2011 00:17:26 +0000 Subject: [PATCH] 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 --- tests/regressiontests/csrf_tests/tests.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/regressiontests/csrf_tests/tests.py b/tests/regressiontests/csrf_tests/tests.py index f2fb409076..6e6c87a112 100644 --- a/tests/regressiontests/csrf_tests/tests.py +++ b/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 @@ class CsrfViewMiddlewareTest(TestCase): 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 @@ class CsrfViewMiddlewareTest(TestCase): 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 @@ class CsrfViewMiddlewareTest(TestCase): """ # 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, (), {})