MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_get_baked_query

Method test_get_baked_query

test/ext/test_horizontal_shard.py:475–490  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

473 eq_(inspect(tokyo_report).identity_token, "asia")
474
475 def test_get_baked_query(self):
476 sess = self._fixture_data()
477
478 tokyo = sess.query(WeatherLocation).filter_by(city="Tokyo").one()
479 tokyo.city
480 sess.expunge_all()
481
482 from sqlalchemy.ext.baked import BakedQuery
483
484 bakery = BakedQuery.bakery()
485
486 bq = bakery(lambda session: session.query(WeatherLocation))
487 t = bq(sess).get(tokyo.id)
488 eq_(t.city, tokyo.city)
489
490 eq_(inspect(t).key[2], "asia")
491
492 def test_get_baked_query_shard_id(self):
493 sess = self._fixture_data()

Callers

nothing calls this directly

Calls 9

_fixture_dataMethod · 0.95
eq_Function · 0.90
inspectFunction · 0.90
bakeryMethod · 0.80
oneMethod · 0.45
filter_byMethod · 0.45
queryMethod · 0.45
expunge_allMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected