'Test that a POST HTTPS request with a good referer is accepted'

def test_https_good_referer(self):

    req = self._get_POST_request_with_token()
    req._is_secure = 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, (), {})
    self.assertEquals(None, req2)
