MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_eager_scalar

Method test_eager_scalar

test/ext/test_associationproxy.py:1450–1469  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1448 self.assert_(p._children is not None)
1449
1450 def test_eager_scalar(self):
1451 Parent, Child = self.classes("Parent", "Child")
1452
1453 self.session = fixture_session()
1454
1455 self.mapper_registry.map_imperatively(
1456 Parent,
1457 self.tables.Parent,
1458 properties={
1459 "_children": relationship(Child, lazy="joined", uselist=False)
1460 },
1461 )
1462
1463 p = Parent("p")
1464 p.children = "value"
1465
1466 p = self.roundtrip(p)
1467
1468 self.assert_("_children" in p.__dict__)
1469 self.assert_(p._children is not None)
1470
1471
1472class Parent:

Callers

nothing calls this directly

Calls 6

roundtripMethod · 0.95
fixture_sessionFunction · 0.90
relationshipFunction · 0.90
map_imperativelyMethod · 0.80
ParentClass · 0.70
assert_Method · 0.45

Tested by

no test coverage detected