Test that the query can have its entities modified in an arbitrary callable, and that this new entity list is preserved when the query is invoked.
(self)
| 637 | ) |
| 638 | |
| 639 | def test_w_new_entities(self): |
| 640 | """Test that the query can have its entities modified in |
| 641 | an arbitrary callable, and that this new entity list is preserved |
| 642 | when the query is invoked. |
| 643 | |
| 644 | """ |
| 645 | User = self.classes.User |
| 646 | |
| 647 | bq = self.bakery(lambda s: s.query(User.id, User.name)) |
| 648 | |
| 649 | bq += lambda q: q._legacy_from_self().with_entities( |
| 650 | func.count(User.id) |
| 651 | ) |
| 652 | |
| 653 | for i in range(3): |
| 654 | session = fixture_session() |
| 655 | eq_(bq(session).all(), [(4,)]) |
| 656 | |
| 657 | def test_conditional_step(self): |
| 658 | """Test a large series of conditionals and assert that |
nothing calls this directly
no test coverage detected