MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_update

Method test_update

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

Source from the content-addressed store, hash-verified

539 cls.mapper_registry.map_imperatively(PkDefault, pk_t)
540
541 def test_update(self):
542 User = self.classes.User
543
544 u = User(name="test")
545
546 session = fixture_session()
547 session.add(u)
548 session.flush()
549
550 eq_(u.counter, 1)
551 u.counter = User.counter + 1
552 session.flush()
553
554 def go():
555 assert (u.counter == 2) is True # ensure its not a ClauseElement
556
557 self.sql_count_(1, go)
558
559 def test_multi_update(self):
560 User = self.classes.User

Callers

nothing calls this directly

Calls 6

fixture_sessionFunction · 0.90
eq_Function · 0.90
sql_count_Method · 0.80
UserClass · 0.70
addMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected