From 9ed66f63bba51a288f160aeaa2cbc54b1805b9a7 Mon Sep 17 00:00:00 2001 From: Charles Leifer Date: Fri, 14 Dec 2018 11:57:22 +0000 Subject: [PATCH] Additional test/assertions for subq in expr. --- tests/models.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/models.py b/tests/models.py index 2370f485b..9f79cb8bb 100644 --- a/tests/models.py +++ b/tests/models.py @@ -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():