code: def test_call_with_invalid_model():
      # 3. Make a call to a key with an invalid model - expect to fail
      setattr(
          litellm.proxy.proxy_server,
          "custom_db_client",
          custom_db_client,
      )
      setattr(litellm.proxy.proxy_server, "master_key", "sk-1234")
      try:
  
          async def test():
              request = NewUserRequest(models=["mistral"])
              key = await new_user(request)
              print(key)
  
              generated_key = key.key
              bearer_token = "Bearer " + generated_key
  
              request = Request(scope={"type": "http"})
              request._url = URL(url="/chat/completions")
  
              async def return_body():
                  return b'{"model": "gemini-pro-vision"}'
  
              request.body = return_body
  
              # use generated key to auth in
              result = await user_api_key_auth(
                  request=request, api_key=bearer_token
              )
              pytest.fail(
                  f"This should have failed!. IT's an invalid model"
              )
  
          asyncio.run(test())
      except Exception as e:
          assert (
              e.detail
              == "Authentication Error, API Key not allowed to access model. This token can only access models=['mistral']. Tried to access gemini-pro-vision"
          )
          pass
  
file_path: litellm/litellm/tests/test_key_generate_dynamodb.py
imports: import sys, os
  import traceback
  from dotenv import load_dotenv
  from fastapi import Request
  import os, io
  import pytest, logging, asyncio
  import litellm, asyncio
  from litellm.proxy.proxy_server import new_user, user_api_key_auth, user_update
  from litellm.proxy._types import NewUserRequest, DynamoDBArgs
  from litellm.proxy.utils import DBClient
  from starlette.datastructures import URL
label_desc: Use image node_id 3 for calling a global function with example usage: test_call_with_invalid_model() and returns: bytes