MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_proxy_descriptor_one

Method test_proxy_descriptor_one

test/orm/test_utils.py:416–432  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

414 )
415
416 def test_proxy_descriptor_one(self):
417 class Point:
418 def __init__(self, x, y):
419 self.x, self.y = x, y
420
421 self._fixture(Point, properties={"x_syn": synonym("x")})
422 alias = aliased(Point)
423
424 eq_(str(Point.x_syn), "Point.x_syn")
425 eq_(str(alias.x_syn), "aliased(Point).x_syn")
426
427 sess = fixture_session()
428 self.assert_compile(
429 sess.query(alias.x_syn).filter(alias.x_syn > Point.x_syn),
430 "SELECT point_1.x AS point_1_x FROM point AS point_1, point "
431 "WHERE point_1.x > point.x",
432 )
433
434 def test_meta_getattr_one(self):
435 class MetaPoint(type):

Callers

nothing calls this directly

Calls 8

_fixtureMethod · 0.95
synonymFunction · 0.90
aliasedFunction · 0.90
eq_Function · 0.90
fixture_sessionFunction · 0.90
assert_compileMethod · 0.80
filterMethod · 0.45
queryMethod · 0.45

Tested by

no test coverage detected