'CSRF cookie age can be set using settings.CSRF_COOKIE_AGE.'

def test_csrf_cookie_age(self):

    req = self._get_GET_no_csrf_cookie_request()
    MAX_AGE = 123
    with self.settings(CSRF_COOKIE_NAME='csrfcookie', CSRF_COOKIE_DOMAIN='.example.com', CSRF_COOKIE_AGE=MAX_AGE, CSRF_COOKIE_PATH='/test/', CSRF_COOKIE_SECURE=True, CSRF_COOKIE_HTTPONLY=True):
        CsrfViewMiddleware().process_view(req, token_view, (), {})
        resp = token_view(req)
        resp2 = CsrfViewMiddleware().process_response(req, resp)
        max_age = resp2.cookies.get('csrfcookie').get('max-age')
        self.assertEqual(max_age, MAX_AGE)
