'When no prior CSRF cookie exists, check that the cookie is created and a
token is inserted.'

def test_process_response_no_csrf_cookie(self):

    req = self._get_GET_no_csrf_cookie_request()
    CsrfMiddleware().process_view(req, post_form_view, (), {})
    resp = post_form_response()
    resp_content = resp.content
    resp2 = CsrfMiddleware().process_response(req, resp)
    csrf_cookie = resp2.cookies.get(settings.CSRF_COOKIE_NAME, False)
    self.assertNotEqual(csrf_cookie, False)
    self.assertNotEqual(resp_content, resp2.content)
    self._check_token_present(resp2, csrf_cookie.value)
    self.assert_(('Cookie' in resp2.get('Vary', '')))
