(self)
| 511 | eq_(bq(session).params(limit=limit, offset=offset).all(), exp) |
| 512 | |
| 513 | def test_disable_on_session(self): |
| 514 | User = self.classes.User |
| 515 | |
| 516 | canary = mock.Mock() |
| 517 | |
| 518 | def fn1(s): |
| 519 | canary.fn1() |
| 520 | return s.query(User.id, User.name).order_by(User.id) |
| 521 | |
| 522 | def fn2(q): |
| 523 | canary.fn2() |
| 524 | return q.filter(User.id == bindparam("id")) |
| 525 | |
| 526 | def fn3(q): |
| 527 | canary.fn3() |
| 528 | return q |
| 529 | |
| 530 | for x in range(3): |
| 531 | bq = self.bakery(fn1) |
| 532 | |
| 533 | bq += fn2 |
| 534 | |
| 535 | sess = fixture_session(enable_baked_queries=False) |
| 536 | eq_(bq.add_criteria(fn3)(sess).params(id=7).all(), [(7, "jack")]) |
| 537 | |
| 538 | eq_( |
| 539 | canary.mock_calls, |
| 540 | [ |
| 541 | mock.call.fn1(), |
| 542 | mock.call.fn2(), |
| 543 | mock.call.fn3(), |
| 544 | mock.call.fn1(), |
| 545 | mock.call.fn2(), |
| 546 | mock.call.fn3(), |
| 547 | mock.call.fn1(), |
| 548 | mock.call.fn2(), |
| 549 | mock.call.fn3(), |
| 550 | ], |
| 551 | ) |
| 552 | |
| 553 | def test_spoiled_full_w_params(self): |
| 554 | User = self.classes.User |
nothing calls this directly
no test coverage detected