(self)
| 455 | ) |
| 456 | |
| 457 | def test_inline_defaults(self): |
| 458 | m = MetaData() |
| 459 | foo = Table("foo", m, Column("id", Integer)) |
| 460 | |
| 461 | t = Table( |
| 462 | "test", |
| 463 | m, |
| 464 | Column("col1", Integer, onupdate=func.foo(1)), |
| 465 | Column( |
| 466 | "col2", |
| 467 | Integer, |
| 468 | onupdate=select(func.coalesce(func.max(foo.c.id))), |
| 469 | ), |
| 470 | Column("col3", String(30)), |
| 471 | ) |
| 472 | |
| 473 | self.assert_compile( |
| 474 | t.update().values({"col3": "foo"}), |
| 475 | "UPDATE test SET col1=foo(:foo_1), col2=(SELECT " |
| 476 | "coalesce(max(foo.id)) AS coalesce_1 FROM foo), " |
| 477 | "col3=:col3", |
| 478 | ) |
| 479 | |
| 480 | self.assert_compile( |
| 481 | t.update().inline().values({"col3": "foo"}), |
| 482 | "UPDATE test SET col1=foo(:foo_1), col2=(SELECT " |
| 483 | "coalesce(max(foo.id)) AS coalesce_1 FROM foo), " |
| 484 | "col3=:col3", |
| 485 | ) |
| 486 | |
| 487 | def test_update_1(self): |
| 488 | table1 = self.tables.mytable |
nothing calls this directly
no test coverage detected