(self)
| 1354 | return self.session.get(type_, id_) |
| 1355 | |
| 1356 | def test_lazy_list(self): |
| 1357 | Parent, Child = self.classes("Parent", "Child") |
| 1358 | |
| 1359 | self.session = fixture_session() |
| 1360 | |
| 1361 | self.mapper_registry.map_imperatively( |
| 1362 | Parent, |
| 1363 | self.tables.Parent, |
| 1364 | properties={ |
| 1365 | "_children": relationship( |
| 1366 | Child, lazy="select", collection_class=list |
| 1367 | ) |
| 1368 | }, |
| 1369 | ) |
| 1370 | |
| 1371 | p = Parent("p") |
| 1372 | p.children = ["a", "b", "c"] |
| 1373 | |
| 1374 | p = self.roundtrip(p) |
| 1375 | |
| 1376 | # Is there a better way to ensure that the association_proxy |
| 1377 | # didn't convert a lazy load to an eager load? This does work though. |
| 1378 | self.assert_("_children" not in p.__dict__) |
| 1379 | self.assert_(len(p._children) == 3) |
| 1380 | self.assert_("_children" in p.__dict__) |
| 1381 | |
| 1382 | def test_eager_list(self): |
| 1383 | Parent, Child = self.classes("Parent", "Child") |
nothing calls this directly
no test coverage detected