Commits

Anonymous committed aed5092

Fixed some failing tests due to creation of HttpRequest._is_secure() methods in [17209]

Comments (0)

Files changed (1)

tests/regressiontests/csrf_tests/tests.py

     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
         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, (), {})
         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, (), {})
         """
         # 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, (), {})