code: def test_parse_search_registered_models_order_by():
      # test that "registered_models.name ASC" is returned by default
      parsed = SqlAlchemyStore._parse_search_registered_models_order_by(
          []
      )
      assert [str(x) for x in parsed] == ["registered_models.name ASC"]
  
      # test that the given 'name' replaces the default one ('registered_models.name ASC')
      parsed = SqlAlchemyStore._parse_search_registered_models_order_by(
          ["name DESC"]
      )
      assert [str(x) for x in parsed] == ["registered_models.name DESC"]
  
      # test that an exception is raised when order_by contains duplicate fields
      msg = "`order_by` contains duplicate fields:"
      with pytest.raises(MlflowException, match=msg):
          SqlAlchemyStore._parse_search_registered_models_order_by(
              ["last_updated_timestamp", "last_updated_timestamp"]
          )
  
      with pytest.raises(MlflowException, match=msg):
          SqlAlchemyStore._parse_search_registered_models_order_by(
              ["timestamp", "timestamp"]
          )
  
      with pytest.raises(MlflowException, match=msg):
          SqlAlchemyStore._parse_search_registered_models_order_by(
              ["timestamp", "last_updated_timestamp"],
          )
  
      with pytest.raises(MlflowException, match=msg):
          SqlAlchemyStore._parse_search_registered_models_order_by(
              [
                  "last_updated_timestamp ASC",
                  "last_updated_timestamp DESC",
              ],
          )
  
      with pytest.raises(MlflowException, match=msg):
          SqlAlchemyStore._parse_search_registered_models_order_by(
              ["last_updated_timestamp", "last_updated_timestamp DESC"],
          )
  
imports: import time
  import uuid
  from unittest import mock
  import pytest
  from mlflow.entities.model_registry import ModelVersion, ModelVersionTag, RegisteredModelTag
  from mlflow.environment_variables import MLFLOW_TRACKING_URI
  from mlflow.exceptions import MlflowException
  from mlflow.protos.databricks_pb2 import INVALID_PARAMETER_VALUE, RESOURCE_ALREADY_EXISTS, RESOURCE_DOES_NOT_EXIST, ErrorCode
  from mlflow.store.model_registry.dbmodels.models import SqlModelVersion, SqlModelVersionTag, SqlRegisteredModel, SqlRegisteredModelTag
  from mlflow.store.model_registry.sqlalchemy_store import SqlAlchemyStore
  from tests.helper_functions import random_str
label_desc: Use image node_id 28 for calling a global function with example usage: test_parse_search_registered_models_order_by() without return types