MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_dupe_cols

Method test_dupe_cols

test/orm/test_query.py:287–304  ·  view source on GitHub ↗

test #6979

(self, test_case, expected_sql, expected_row)

Source from the content-addressed store, hash-verified

285 ),
286 )
287 def test_dupe_cols(self, test_case, expected_sql, expected_row):
288 """test #6979"""
289 User, users = self.classes.User, self.tables.users
290
291 self.mapper_registry.map_imperatively(User, users)
292
293 s = fixture_session()
294
295 expressions = testing.resolve_lambda(test_case, **locals())
296 expected_num = len(expressions)
297
298 q = s.query(*expressions)
299
300 self.assert_compile(q, "SELECT %s FROM users" % expected_sql)
301
302 row = q.order_by(User.id).first()
303 eq_(row, expected_row)
304 eq_(len(row), expected_num)
305
306 @testing.combinations(
307 (lambda s, users: s.query(users),),

Callers

nothing calls this directly

Calls 8

fixture_sessionFunction · 0.90
eq_Function · 0.90
localsFunction · 0.85
map_imperativelyMethod · 0.80
assert_compileMethod · 0.80
queryMethod · 0.45
firstMethod · 0.45
order_byMethod · 0.45

Tested by

no test coverage detected