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

Method test_eager_scalar

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

Source from the content-addressed store, hash-verified

1389 self.assert_(p._children is not None)
1390
1391 def test_eager_scalar(self):
1392 Parent, Child = self.classes("Parent", "Child")
1393
1394 self.session = fixture_session()
1395
1396 self.mapper_registry.map_imperatively(
1397 Parent,
1398 self.tables.Parent,
1399 properties={
1400 "_children": relationship(Child, lazy="joined", uselist=False)
1401 },
1402 )
1403
1404 p = Parent("p")
1405 p.children = "value"
1406
1407 p = self.roundtrip(p)
1408
1409 self.assert_("_children" in p.__dict__)
1410 self.assert_(p._children is not None)
1411
1412
1413class 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