(self)
| 285 | ) |
| 286 | |
| 287 | def test_bulk_update(self): |
| 288 | Foo = self.classes.Foo |
| 289 | |
| 290 | s1 = self._fixture() |
| 291 | f1 = Foo(value="f1") |
| 292 | f2 = Foo(value="f2") |
| 293 | s1.add_all((f1, f2)) |
| 294 | s1.commit() |
| 295 | |
| 296 | with conditional_sane_rowcount_warnings(update=True): |
| 297 | s1.bulk_update_mappings( |
| 298 | Foo, |
| 299 | [ |
| 300 | {"id": f1.id, "value": "f1rev2", "version_id": 1}, |
| 301 | {"id": f2.id, "value": "f2rev2", "version_id": 1}, |
| 302 | ], |
| 303 | ) |
| 304 | s1.commit() |
| 305 | |
| 306 | eq_( |
| 307 | s1.query(Foo.id, Foo.value, Foo.version_id).order_by(Foo.id).all(), |
| 308 | [(f1.id, "f1rev2", 2), (f2.id, "f2rev2", 2)], |
| 309 | ) |
| 310 | |
| 311 | def test_bump_version(self): |
| 312 | """test that version number can be bumped. |
nothing calls this directly
no test coverage detected