(self)
| 4574 | ) |
| 4575 | |
| 4576 | def test_ordering(self): |
| 4577 | a, m2m, b = (self.tables.a, self.tables.m2m, self.tables.b) |
| 4578 | |
| 4579 | class A(ComparableEntity): |
| 4580 | pass |
| 4581 | |
| 4582 | class B(ComparableEntity): |
| 4583 | pass |
| 4584 | |
| 4585 | self.mapper_registry.map_imperatively( |
| 4586 | A, |
| 4587 | a, |
| 4588 | properties={ |
| 4589 | "bs": relationship( |
| 4590 | B, secondary=m2m, lazy="joined", order_by=m2m.c.id |
| 4591 | ) |
| 4592 | }, |
| 4593 | ) |
| 4594 | self.mapper_registry.map_imperatively(B, b) |
| 4595 | |
| 4596 | sess = fixture_session() |
| 4597 | eq_( |
| 4598 | sess.query(A).all(), |
| 4599 | [ |
| 4600 | A(data="a1", bs=[B(data="b3"), B(data="b1"), B(data="b2")]), |
| 4601 | A(bs=[B(data="b4"), B(data="b3"), B(data="b2")]), |
| 4602 | ], |
| 4603 | ) |
| 4604 | |
| 4605 | |
| 4606 | class SelfReferentialEagerTest(fixtures.MappedTest): |
nothing calls this directly
no test coverage detected