(self)
| 205 | eq_(list(q2.with_entities(User.id, User.name)), [(9, "fred")]) |
| 206 | |
| 207 | def test_query_three(self): |
| 208 | ua = aliased(User) |
| 209 | q = ( |
| 210 | Session.query(ua) |
| 211 | .join(ua.addresses) |
| 212 | .filter(Address.email.like("%fred%")) |
| 213 | ) |
| 214 | for prot in pickle_protocols(): |
| 215 | q2 = serializer.loads( |
| 216 | serializer.dumps(q, prot), users.metadata, Session |
| 217 | ) |
| 218 | eq_(q2.all(), [User(name="fred")]) |
| 219 | |
| 220 | # try to pull out the aliased entity here... |
| 221 | ua_2 = q2._compile_state()._entities[0].entity_zero.entity |
| 222 | eq_(list(q2.with_entities(ua_2.id, ua_2.name)), [(9, "fred")]) |
| 223 | |
| 224 | def test_annotated_one(self): |
| 225 | j = join(users, addresses)._annotate({"foo": "bar"}) |
nothing calls this directly
no test coverage detected