Commit 6cca104b authored by Adrian Holovaty's avatar Adrian Holovaty
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
parent 1b312edb
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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, (), {})