def test_simple(self): t2 = d.table(TestModel2) r = t2.where(t2.c > d.const(3)).project(t2.c).all() self.assertEqual(3, len(list(r))) r = t2.where(t2.c > d.const(3) + d.const(1)).project(t2.c).all() self.assertEqual(2, len(list(r)))
def test_select_expr(self): t2 = d.table(TestModel2) a = t2.project((d.max(t2.c) - d.const(2)).label("total")).subquery r = t2.project(t2.c).where(t2.c > a).all() self.assertEqual(2, len(list(r)))