MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_locates_col

Method test_locates_col

test/orm/test_deferred.py:1050–1075  ·  view source on GitHub ↗

changed in 1.0 - we don't search for deferred cols in the result now.

(self)

Source from the content-addressed store, hash-verified

1048 )
1049
1050 def test_locates_col(self):
1051 """changed in 1.0 - we don't search for deferred cols in the result
1052 now."""
1053
1054 orders, Order = self.tables.orders, self.classes.Order
1055
1056 self.mapper_registry.map_imperatively(
1057 Order,
1058 orders,
1059 properties={"description": deferred(orders.c.description)},
1060 )
1061
1062 sess = fixture_session()
1063 o1 = (
1064 sess.query(Order)
1065 .order_by(Order.id)
1066 .add_columns(orders.c.description)
1067 .first()
1068 )[0]
1069
1070 def go():
1071 eq_(o1.description, "order 1")
1072
1073 # prior to 1.0 we'd search in the result for this column
1074 # self.sql_count_(0, go)
1075 self.sql_count_(1, go)
1076
1077 def test_locates_col_rowproc_only(self):
1078 """changed in 1.0 - we don't search for deferred cols in the result

Callers

nothing calls this directly

Calls 8

deferredFunction · 0.90
fixture_sessionFunction · 0.90
map_imperativelyMethod · 0.80
sql_count_Method · 0.80
firstMethod · 0.45
add_columnsMethod · 0.45
order_byMethod · 0.45
queryMethod · 0.45

Tested by

no test coverage detected