'Check that CsrfTokenNode works when a CSRF cookie is created by
the middleware (when one was not already present)'

def test_token_node_with_new_csrf_cookie(self):

    req = self._get_GET_no_csrf_cookie_request()
    CsrfViewMiddleware().process_view(req, token_view, (), {})
    resp = token_view(req)
    resp2 = CsrfViewMiddleware().process_response(req, resp)
    csrf_cookie = resp2.cookies[settings.CSRF_COOKIE_NAME]
    self._check_token_present(resp, csrf_id=csrf_cookie.value)
