(self)
| 2263 | eq_(a1.all(), [A(my_expr=5), A(my_expr=15), A(my_expr=12)]) |
| 2264 | |
| 2265 | def test_expr_default_value(self): |
| 2266 | A = self.classes.A |
| 2267 | C = self.classes.C |
| 2268 | s = fixture_session() |
| 2269 | |
| 2270 | a1 = s.query(A).order_by(A.id).filter(A.x > 1) |
| 2271 | eq_(a1.all(), [A(my_expr=None), A(my_expr=None), A(my_expr=None)]) |
| 2272 | |
| 2273 | c1 = s.query(C).order_by(C.id) |
| 2274 | eq_(c1.all(), [C(c_expr=1), C(c_expr=1)]) |
| 2275 | |
| 2276 | s.expunge_all() |
| 2277 | |
| 2278 | c2 = ( |
| 2279 | s.query(C) |
| 2280 | .options(with_expression(C.c_expr, C.x * 2)) |
| 2281 | .filter(C.x > 1) |
| 2282 | .order_by(C.id) |
| 2283 | ) |
| 2284 | eq_(c2.all(), [C(c_expr=4)]) |
| 2285 | |
| 2286 | def test_non_cacheable_expr(self): |
| 2287 | """test #10990""" |
nothing calls this directly
no test coverage detected