test #6420. a noload that hits the dynamic loader should have no effect.
(self, type_, user_address_fixture)
| 2327 | |
| 2328 | @testing.combinations(("star",), ("attronly",), argnames="type_") |
| 2329 | def test_noload_issue(self, type_, user_address_fixture): |
| 2330 | """test #6420. a noload that hits the dynamic loader |
| 2331 | should have no effect. |
| 2332 | |
| 2333 | """ |
| 2334 | |
| 2335 | User, Address = user_address_fixture() |
| 2336 | |
| 2337 | s = fixture_session() |
| 2338 | |
| 2339 | with expect_noload_deprecation(): |
| 2340 | |
| 2341 | if type_ == "star": |
| 2342 | u1 = s.query(User).filter_by(id=7).options(noload("*")).first() |
| 2343 | assert "name" not in u1.__dict__["name"] |
| 2344 | elif type_ == "attronly": |
| 2345 | u1 = ( |
| 2346 | s.query(User) |
| 2347 | .filter_by(id=7) |
| 2348 | .options(noload(User.addresses)) |
| 2349 | .first() |
| 2350 | ) |
| 2351 | |
| 2352 | eq_(u1.__dict__["name"], "jack") |
| 2353 | |
| 2354 | |
| 2355 | class ExpireTest(_fixtures.FixtureTest): |
nothing calls this directly
no test coverage detected