MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_update_w_fetch

Method test_update_w_fetch

test/orm/dml/test_bulk.py:427–443  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

425 s.commit()
426
427 def test_update_w_fetch(self):
428 A = self.classes.A
429
430 s = fixture_session()
431 a1 = A(x=1, y=2)
432 s.add(a1)
433 s.commit()
434
435 eq_(a1.id, 1) # force a load
436 a1.x = 5
437 s.expire(a1, ["y"])
438 assert "y" not in a1.__dict__
439 s.bulk_save_objects([a1])
440 s.commit()
441
442 eq_(a1.x, 5)
443 eq_(a1.y, 2)
444
445
446class BulkUDTestAltColKeys(BulkTest, fixtures.MappedTest):

Callers

nothing calls this directly

Calls 7

fixture_sessionFunction · 0.90
eq_Function · 0.90
AClass · 0.70
addMethod · 0.45
commitMethod · 0.45
expireMethod · 0.45
bulk_save_objectsMethod · 0.45

Tested by

no test coverage detected