MCPcopy Index your code
hub / github.com/webpy/webpy / testNestedTransactions

Method testNestedTransactions

tests/test_db.py:128–143  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

126 self.db.select("person")
127
128 def testNestedTransactions(self):
129 t1 = self.db.transaction()
130 self.db.insert("person", False, name="user1")
131 self.assertRows(1)
132
133 t2 = self.db.transaction()
134 self.db.insert("person", False, name="user2")
135 self.assertRows(2)
136 t2.rollback()
137 self.assertRows(1)
138 t3 = self.db.transaction()
139 self.db.insert("person", False, name="user3")
140 self.assertRows(2)
141 t3.commit()
142 t1.commit()
143 self.assertRows(2)
144
145 def testPooling(self):
146 # can't test pooling if DBUtils is not installed

Callers

nothing calls this directly

Calls 5

assertRowsMethod · 0.95
transactionMethod · 0.80
insertMethod · 0.80
rollbackMethod · 0.45
commitMethod · 0.45

Tested by

no test coverage detected