MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_aliased_delete

Method test_aliased_delete

test/orm/test_core_compilation.py:610–626  ·  view source on GitHub ↗

test #10279

(self, stmt_type: testing.Variation)

Source from the content-addressed store, hash-verified

608
609 @testing.variation("stmt_type", ["core", "orm"])
610 def test_aliased_delete(self, stmt_type: testing.Variation):
611 """test #10279"""
612 if stmt_type.orm:
613 User = self.classes.User
614 u1 = aliased(User)
615 stmt = delete(u1).where(u1.name == "xyz")
616 elif stmt_type.core:
617 user_table = self.tables.users
618 u1 = user_table.alias()
619 stmt = delete(u1).where(u1.c.name == "xyz")
620 else:
621 stmt_type.fail()
622
623 self.assert_compile(
624 stmt,
625 "DELETE FROM users AS users_1 WHERE users_1.name = :name_1",
626 )
627
628 @testing.variation("stmt_type", ["core", "orm"])
629 def test_add_cte(self, stmt_type: testing.Variation):

Callers

nothing calls this directly

Calls 6

aliasedFunction · 0.90
deleteFunction · 0.90
assert_compileMethod · 0.80
whereMethod · 0.45
aliasMethod · 0.45
failMethod · 0.45

Tested by

no test coverage detected