(self, connection)
| 1618 | counter = mapped_column(Integer, onupdate=_counter) |
| 1619 | |
| 1620 | def test_update_counter(self, connection): |
| 1621 | Parent, Related = self.classes("Parent", "Related") |
| 1622 | |
| 1623 | p1 = Parent(related=[Related(), Related(), Related()]) |
| 1624 | with Session(connection, expire_on_commit=False) as sess: |
| 1625 | sess.add(p1) |
| 1626 | sess.commit() |
| 1627 | |
| 1628 | eq_([rel.counter for rel in p1.related], [1, 2, 3]) |
| 1629 | |
| 1630 | |
| 1631 | class PostUpdateBatchingTest(fixtures.MappedTest): |