def METHOD_NAME(self):
    payload = {"name": "Test Model", "api_key": "invalid_api_key"}
    response = self.client.post("/admin/store/1/models", data=payload)
    data = response.json
    self.assertEqual(response.status_code, 500)
    self.assertFalse(data["success"])
    self.assertIn("Invalid API key", data["message"])