'Referer header is strictly checked for POST over HTTPS. Trigger the
exception by sending an incorrect referer.'

@override_settings(SECURE_PROXY_SSL_HEADER=('HTTP_X_FORWARDED_PROTO', 'https'))
def test_no_referer(self):

    response = self.client.post('/', HTTP_X_FORWARDED_PROTO='https')
    self.assertContains(response, 'You    are    seeing    this    message    because    this    HTTPS    site    requires    a    &#39;Referer    header&#39;    to    be    sent    by    your    Web    browser,    but    none    was    sent.', status_code=403)
    self.assertContains(response, 'If    you    have    configured    your    browser    to    disable    &#39;Referer&#39;    headers,    please    re-enable    them,    at    least    for    this    site,    or    for    HTTPS    connections,    or    for    &#39;same-origin&#39;    requests.', status_code=403)
    self.assertContains(response, 'If    you    are    using    the    &lt;meta    name=&quot;referrer&quot;    content=&quot;no-referrer&quot;&gt;    tag    or    including    the    &#39;Referrer-Policy:    no-referrer&#39;    header,    please    remove    them.', status_code=403)
