MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_no_uniquing_cols

Method test_no_uniquing_cols

test/orm/test_froms.py:1875–1899  ·  view source on GitHub ↗

test #6924

(self, with_entities)

Source from the content-addressed store, hash-verified

1873
1874 @testing.combinations((True,), (False,))
1875 def test_no_uniquing_cols(self, with_entities):
1876 """test #6924"""
1877 User = self.classes.User
1878 Address = self.classes.Address
1879
1880 if with_entities:
1881 stmt = (
1882 select(User)
1883 .join(Address)
1884 .filter(Address.user_id == 8)
1885 .with_only_columns(User.id, User.name)
1886 .order_by(User.id)
1887 )
1888 else:
1889 stmt = (
1890 select(User.id, User.name)
1891 .join(Address)
1892 .filter(Address.user_id == 8)
1893 .order_by(User.id)
1894 )
1895
1896 compile_state = _ORMSelectCompileState._create_orm_context(
1897 stmt, toplevel=True, compiler=None
1898 )
1899 is_(compile_state._primary_entity, None)
1900
1901 def test_column_queries_one(self):
1902 User = self.classes.User

Callers

nothing calls this directly

Calls 7

selectFunction · 0.90
is_Function · 0.90
with_only_columnsMethod · 0.80
order_byMethod · 0.45
filterMethod · 0.45
joinMethod · 0.45
_create_orm_contextMethod · 0.45

Tested by

no test coverage detected