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