'The csrf token is reset from a bare secret.'

def test_bare_secret_accepted_and_replaced(self):

    req = self._get_POST_bare_secret_csrf_cookie_request_with_token()
    req2 = CsrfViewMiddleware().process_view(req, token_view, (), {})
    self.assertIsNone(req2)
    resp = token_view(req)
    resp = CsrfViewMiddleware().process_response(req, resp)
    self.assertIn(settings.CSRF_COOKIE_NAME, resp.cookies, 'Cookie    was    not    reset    from    bare    secret')
    csrf_cookie = resp.cookies[settings.CSRF_COOKIE_NAME]
    self.assertEqual(len(csrf_cookie.value), CSRF_TOKEN_LENGTH)
    self._check_token_present(resp, csrf_id=csrf_cookie.value)
