def METHOD_NAME(self, pyramid_request, CookiePolicy):
    policy = SecurityPolicy()
    policy.identity(pyramid_request)
    policy.identity(pyramid_request)
    CookiePolicy.return_value.identity.assert_called_once()