| 207 | is_(s._transaction, None) |
| 208 | |
| 209 | def test_autobegin_flush(self): |
| 210 | # test the new autobegin behavior introduced in #5074 |
| 211 | User, users = self.classes.User, self.tables.users |
| 212 | |
| 213 | self.mapper_registry.map_imperatively(User, users) |
| 214 | |
| 215 | s = Session(testing.db) |
| 216 | |
| 217 | is_(s._transaction, None) |
| 218 | |
| 219 | # empty flush, nothing happens |
| 220 | s.flush() |
| 221 | is_(s._transaction, None) |
| 222 | |
| 223 | s.add(User(id=1, name="name")) |
| 224 | s.flush() |
| 225 | is_not(s._transaction, None) |
| 226 | s.commit() |
| 227 | is_(s._transaction, None) |
| 228 | |
| 229 | def test_autobegin_within_flush(self): |
| 230 | """test :ticket:`6233`""" |