'Anonymous cookie is already set.
Make sure the value is read correctly and a new one isn\'t set.'

def test_cookie_exists(self):

    request = RequestFactory().request()
    anon_id = '63de20c227be94560e3c679330c678ee'
    request.COOKIES[settings.ANONYMOUS_COOKIE_NAME] = anon_id
    self.middleware.process_request(request)
    eq_(True, request.anonymous.has_id)
    eq_(anon_id, request.anonymous.anonymous_id)
    response = HttpResponse()
    response = self.middleware.process_response(request, response)
    eq_(False, (settings.ANONYMOUS_COOKIE_NAME in response.cookies))
