code: def test_basic(self):
      table2, table1 = self.tables.table2, self.tables.table1
  
      Session = scoped_session(sa.orm.sessionmaker(testing.db))
  
      class CustomQuery(query.Query):
          pass
  
      class SomeObject(ComparableEntity):
          query = Session.query_property()
  
      class SomeOtherObject(ComparableEntity):
          query = Session.query_property()
          custom_query = Session.query_property(query_cls=CustomQuery)
  
      self.mapper_registry.map_imperatively(
          SomeObject,
          table1,
          properties={"options": relationship(SomeOtherObject)},
      )
      self.mapper_registry.map_imperatively(SomeOtherObject, table2)
  
      s = SomeObject(id=1, data="hello")
      sso = SomeOtherObject()
      s.options.append(sso)
      Session.add(s)
      Session.commit()
      Session.refresh(sso)
      Session.remove()
  
      eq_(
          SomeObject(
              id=1, data="hello", options=[SomeOtherObject(someid=1)]
          ),
          Session.query(SomeObject).one(),
      )
      eq_(
          SomeObject(
              id=1, data="hello", options=[SomeOtherObject(someid=1)]
          ),
          SomeObject.query.one(),
      )
      eq_(
          SomeOtherObject(someid=1),
          SomeOtherObject.query.filter(
              SomeOtherObject.someid == sso.someid
          ).one(),
      )
      assert isinstance(SomeOtherObject.query, query.Query)
      assert not isinstance(SomeOtherObject.query, CustomQuery)
      assert isinstance(SomeOtherObject.custom_query, query.Query)
  
imports: from unittest.mock import Mock
  import sqlalchemy
  from sqlalchemy import ForeignKey
  from sqlalchemy import Integer
  from sqlalchemy import String
  from sqlalchemy import testing
  from sqlalchemy import util
  from sqlalchemy.orm import query
  from sqlalchemy.orm import relationship
  from sqlalchemy.orm import scoped_session
  from sqlalchemy.orm import Session
  from sqlalchemy.orm import sessionmaker
  from sqlalchemy.testing import assert_raises_message
  from sqlalchemy.testing import assert_warns_message
  from sqlalchemy.testing import eq_
  from sqlalchemy.testing import fixtures
  from sqlalchemy.testing import is_
  from sqlalchemy.testing import mock
  from sqlalchemy.testing.entities import ComparableEntity
  from sqlalchemy.testing.schema import Column
  from sqlalchemy.testing.schema import Table
label_desc: Use image node_id 2 for calling the ScopedSessionTest obj's underlying member method code with example usage: obj.test_basic() without return types