code: def test_train_model(client):
      # Learning Hub home rentals model.
      create_query = """
          CREATE MODEL mindsdb.home_rentals_model
          FROM example_db (SELECT * FROM demo_data.home_rentals)
          PREDICT rental_price
      """
      train_data = {"query": create_query}
      response = client.post(
          "/api/projects/mindsdb/models",
          json=train_data,
          follow_redirects=True,
      )
      assert "201" in response.status
      created_model = response.get_json()
  
      expected_model = {
          "accuracy": None,
          "active": True,
          "error": None,
          "fetch_data_query": "SELECT * FROM demo_data.home_rentals",
          "mindsdb_version": created_model["mindsdb_version"],
          "name": "home_rentals_model",
          "predict": "rental_price",
          "status": "generating",
          "version": 1,
          "problem_definition": "{'target': 'rental_price'}",
      }
  
      assert created_model == expected_model
  
imports: import os
  import pytest
  from tempfile import TemporaryDirectory
  from mindsdb.api.http.initialize import initialize_app
  from mindsdb.migrations import migrate
  from mindsdb.interfaces.storage import db
  from mindsdb.utilities.config import Config
label_desc: Use image node_id 3 for calling a global function with example usage: test_train_model(client) without return types