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