'A POST HTTPS request with a referer added to the CSRF_TRUSTED_ORIGINS
setting is accepted.'

@override_settings(ALLOWED_HOSTS=['www.example.com'], CSRF_TRUSTED_ORIGINS=['dashboard.example.com'])
def test_https_csrf_trusted_origin_allowed(self):

    req = self._get_POST_request_with_token()
    req._is_secure_override = True
    req.META['HTTP_HOST'] = 'www.example.com'
    req.META['HTTP_REFERER'] = 'https://dashboard.example.com'
    req2 = CsrfViewMiddleware().process_view(req, post_form_view, (), {})
    self.assertIsNone(req2)
