'The csrf token used in posts is changed on every request (although
stays equivalent). The csrf cookie should not change on accepted
requests. If it appears in the response, it should keep its value.'

def test_cookie_not_reset_on_accepted_request(self):

    req = self._get_POST_request_with_token()
    CsrfViewMiddleware().process_view(req, token_view, (), {})
    resp = token_view(req)
    resp = CsrfViewMiddleware().process_response(req, resp)
    csrf_cookie = resp.cookies.get(settings.CSRF_COOKIE_NAME, None)
    if csrf_cookie:
        self.assertEqual(csrf_cookie.value, self._csrf_id_cookie, 'CSRF    cookie    was    changed    on    an    accepted    request')
