MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / test_table_alias_2

Method test_table_alias_2

test/sql/test_labels.py:203–231  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

201 )
202
203 def test_table_alias_2(self):
204 table1 = self.table1
205 table2 = self.table2
206 ta = table2.alias()
207 on = table1.c.this_is_the_data_column == ta.c.this_is_the_data_column
208 self.assert_compile(
209 select(table1, ta)
210 .select_from(table1.join(ta, on))
211 .where(ta.c.this_is_the_data_column == "data3")
212 .set_label_style(LABEL_STYLE_NONE),
213 "SELECT "
214 "some_large_named_table.this_is_the_primarykey_column, "
215 "some_large_named_table.this_is_the_data_column, "
216 "table_with_exactly_29_c_1.this_is_the_primarykey_column, "
217 "table_with_exactly_29_c_1.this_is_the_data_column "
218 "FROM "
219 "some_large_named_table "
220 "JOIN "
221 "table_with_exactly_29_characs "
222 "AS "
223 "table_with_exactly_29_c_1 "
224 "ON "
225 "some_large_named_table.this_is_the_data_column = "
226 "table_with_exactly_29_c_1.this_is_the_data_column "
227 "WHERE "
228 "table_with_exactly_29_c_1.this_is_the_data_column = "
229 ":this_is_the_data_column_1",
230 dialect=self._length_fixture(),
231 )
232
233 def test_too_long_name_disallowed(self):
234 m = MetaData()

Callers

nothing calls this directly

Calls 8

_length_fixtureMethod · 0.95
selectFunction · 0.90
assert_compileMethod · 0.80
aliasMethod · 0.45
set_label_styleMethod · 0.45
whereMethod · 0.45
select_fromMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected