Skip to content

Commit

Permalink
Additional test/assertions for subq in expr.
Browse files Browse the repository at this point in the history
  • Loading branch information
coleifer committed Dec 14, 2018
1 parent fb41bfc commit 9ed66f6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -997,6 +997,13 @@ def test_subquery_in_select_expression(self):
(10, 10, 30),
(10, 20, 30)])

query = (Point
.select(Point.x, (Point.y + subq).alias('sy'))
.order_by(Point.x, Point.y))
self.assertEqual(list(query.tuples()), [
(1, 4), (1, 5),
(10, 40), (10, 50)])

@requires_models(User, Tweet)
def test_filtering(self):
with self.database.atomic():
Expand Down

0 comments on commit 9ed66f6

Please sign in to comment.