MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_column_property

Method test_column_property

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

Source from the content-addressed store, hash-verified

7248 )
7249
7250 def test_column_property(self):
7251 User = self.classes.User
7252
7253 mapper = inspect(User)
7254 mapper.add_property(
7255 "score",
7256 column_property(func.coalesce(self.tables.users.c.name, None)),
7257 )
7258 session = fixture_session()
7259 with self._assert_bind_args(session, expect_mapped_bind=True):
7260 session.query(func.max(User.score)).scalar()
7261
7262 def test_plain_table(self):
7263 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