test the same as withjoinedload except using generative
(self)
| 283 | eq_(result_str, ["1 Some Category", "3 Some Category"]) |
| 284 | |
| 285 | def test_dslish(self): |
| 286 | """test the same as withjoinedload except using generative""" |
| 287 | |
| 288 | Thing, tests, options = ( |
| 289 | self.classes.Thing, |
| 290 | self.tables.tests, |
| 291 | self.tables.options, |
| 292 | ) |
| 293 | |
| 294 | s = fixture_session() |
| 295 | q = s.query(Thing).options(sa.orm.joinedload(Thing.category)) |
| 296 | result = q.filter( |
| 297 | sa.and_( |
| 298 | tests.c.owner_id == 1, |
| 299 | sa.or_( |
| 300 | options.c.someoption == None, |
| 301 | options.c.someoption == False, # noqa |
| 302 | ), |
| 303 | ) |
| 304 | ).outerjoin(Thing.owner_option) |
| 305 | |
| 306 | result_str = ["%d %s" % (t.id, t.category.name) for t in result] |
| 307 | eq_(result_str, ["1 Some Category", "3 Some Category"]) |
| 308 | |
| 309 | def test_without_outerjoin_literal(self): |
| 310 | Thing, tests = (self.classes.Thing, self.tables.tests) |
nothing calls this directly
no test coverage detected