code: def test_create_model(self):
      sql = """
          CREATE DATABASE example_db
          WITH ENGINE = "postgres",
          PARAMETERS = {
              "user": "demo_user",
              "password": "demo_password",
              "host": "3.220.66.106",
              "port": "5432",
              "database": "demo"
              };
          """
      resp = self.sql_via_http(sql, RESPONSE_TYPE.OK)
  
      groups = ["a", "b"]
      selects = []
      for i in range(30):
          day_str = str(
              datetime.date.today() + datetime.timedelta(days=i)
          )
          for group in groups:
              value = random.randint(0, 10)
              selects.append(
                  f"select '{day_str}' as date, '{group}' as group, {value} as value"
              )
      selects = " union all ".join(selects)
  
      sql = f"""
              create view testv as (
                  select * from example_db ({selects})
              )
          """
  
      resp = self.sql_via_http(sql, RESPONSE_TYPE.OK)
  
      sql = """
              CREATE MODEL
                  mindsdb.tstest
              FROM mindsdb (select * from testv)
              PREDICT value
              ORDER BY date
              GROUP BY group
              WINDOW 5
              HORIZON 3;
          """
      resp = self.sql_via_http(sql, RESPONSE_TYPE.TABLE)
  
      assert len(resp["data"]) == 1
      status = resp["column_names"].index("STATUS")
      assert resp["data"][0][status] == "generating"
  
      self.await_model("tstest")
  
file_path: mindsdb/tests/integration_tests/flows/test_ts_predictions.py
imports: import datetime
  import random
  import pytest
  from mindsdb.api.executor.data_types.response_type import RESPONSE_TYPE
  from .http_test_helpers import HTTPHelperMixin
label_desc: Use image node_id 2 for calling the TestHTTP obj's underlying member method code with example usage: obj.test_create_model() without return types