(self)
| 279 | ) |
| 280 | |
| 281 | def test_joinedload(self): |
| 282 | A, B = self.classes("A", "B") |
| 283 | |
| 284 | sess = fixture_session() |
| 285 | |
| 286 | with self.sql_execution_asserter() as asserter: |
| 287 | # note this is many-to-one. use_get is unconditionally turned |
| 288 | # off for relationship to aliased class for now. |
| 289 | a1 = sess.query(A).options(joinedload(A.b)).first() |
| 290 | eq_(a1.b, B(id=1)) |
| 291 | |
| 292 | asserter.assert_( |
| 293 | CompiledSQL( |
| 294 | "SELECT a.id AS a_id, a.b_id AS a_b_id, b_1.id AS b_1_id " |
| 295 | "FROM a LEFT OUTER JOIN (b AS b_1 " |
| 296 | "JOIN d AS d_1 ON d_1.b_id = b_1.id " |
| 297 | "JOIN c AS c_1 ON c_1.id = d_1.c_id) ON a.b_id = b_1.id " |
| 298 | "LIMIT :param_1", |
| 299 | [{"param_1": 1}], |
| 300 | ) |
| 301 | ) |
| 302 | |
| 303 | def test_selectinload(self): |
| 304 | A, B = self.classes("A", "B") |
nothing calls this directly
no test coverage detected