MCPcopy Index your code
hub / github.com/sqlalchemy/sqlalchemy / test_insert_nopostfetch

Method test_insert_nopostfetch

test/orm/test_unitofwork.py:1248–1265  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1246 eq_(h2.counter, 5)
1247
1248 def test_insert_nopostfetch(self):
1249 default_t, Hoho = self.tables.default_t, self.classes.Hoho
1250
1251 # populates from the FetchValues explicitly so there is no
1252 # "post-update"
1253 self.mapper_registry.map_imperatively(Hoho, default_t)
1254
1255 h1 = Hoho(hoho="15", counter=15)
1256 session = fixture_session()
1257 session.add(h1)
1258 session.flush()
1259
1260 def go():
1261 eq_(h1.hoho, "15")
1262 eq_(h1.counter, 15)
1263 eq_(h1.foober, "im foober")
1264
1265 self.sql_count_(0, go)
1266
1267 def test_update(self):
1268 default_t, Hoho = self.tables.default_t, self.classes.Hoho

Callers

nothing calls this directly

Calls 6

fixture_sessionFunction · 0.90
map_imperativelyMethod · 0.80
sql_count_Method · 0.80
HohoClass · 0.70
addMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected