'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)
    CsrfViewMiddleware().process_response(req, resp)
    csrf_cookie = req.session[CSRF_SESSION_KEY]
    self._check_token_present(resp, csrf_id=csrf_cookie)
