MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_multi_update

Method test_multi_update

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

Source from the content-addressed store, hash-verified

557 self.sql_count_(1, go)
558
559 def test_multi_update(self):
560 User = self.classes.User
561
562 u = User(name="test")
563
564 session = fixture_session()
565 session.add(u)
566 session.flush()
567
568 eq_(u.counter, 1)
569 u.name = "test2"
570 u.counter = User.counter + 1
571 session.flush()
572
573 def go():
574 eq_(u.name, "test2")
575 assert (u.counter == 2) is True
576
577 self.sql_count_(1, go)
578
579 session.expunge_all()
580 u = session.get(User, u.id)
581 eq_(u.name, "test2")
582 eq_(u.counter, 2)
583
584 def test_insert(self):
585 User = self.classes.User

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected