MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_update_to_expression_one

Method test_update_to_expression_one

test/sql/test_update.py:848–862  ·  view source on GitHub ↗

test update from an expression. this logic is triggered currently by a left side that doesn't have a key. The current supported use case is updating the index of a PostgreSQL ARRAY type.

(self)

Source from the content-addressed store, hash-verified

846 )
847
848 def test_update_to_expression_one(self):
849 """test update from an expression.
850
851 this logic is triggered currently by a left side that doesn't
852 have a key. The current supported use case is updating the index
853 of a PostgreSQL ARRAY type.
854
855 """
856 table1 = self.tables.mytable
857 expr = func.foo(table1.c.myid)
858 eq_(expr.key, None)
859 self.assert_compile(
860 table1.update().values({expr: "bar"}),
861 "UPDATE mytable SET foo(myid)=:param_1",
862 )
863
864 def random_update_order_parameters():
865 from sqlalchemy import ARRAY

Callers

nothing calls this directly

Calls 5

eq_Function · 0.90
assert_compileMethod · 0.80
fooMethod · 0.45
valuesMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected