MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / test_column_property

Method test_column_property

test/orm/test_query.py:7775–7785  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

7773 )
7774
7775 def test_column_property(self):
7776 User = self.classes.User
7777
7778 mapper = inspect(User)
7779 mapper.add_property(
7780 "score",
7781 column_property(func.coalesce(self.tables.users.c.name, None)),
7782 )
7783 session = fixture_session()
7784 with self._assert_bind_args(session, expect_mapped_bind=True):
7785 session.query(func.max(User.score)).scalar()
7786
7787 def test_plain_table(self):
7788 User = self.classes.User

Callers

nothing calls this directly

Calls 9

_assert_bind_argsMethod · 0.95
inspectFunction · 0.90
column_propertyFunction · 0.90
fixture_sessionFunction · 0.90
add_propertyMethod · 0.80
coalesceMethod · 0.80
maxMethod · 0.80
scalarMethod · 0.45
queryMethod · 0.45

Tested by

no test coverage detected