summaryrefslogtreecommitdiff
path: root/test/sql/select.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2008-01-07 18:52:02 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2008-01-07 18:52:02 +0000
commite8feacf1db658ecccf7bb1d1688662e701ad37f5 (patch)
tree9506104355f841bea36526cd6c66b4f5e21639e5 /test/sql/select.py
parentacd13f99f18ad02b2e51e8be7303124e40c55473 (diff)
downloadsqlalchemy-e8feacf1db658ecccf7bb1d1688662e701ad37f5.tar.gz
- fixed an attribute history bug whereby assigning a new collection
to a collection-based attribute which already had pending changes would generate incorrect history [ticket:922] - fixed delete-orphan cascade bug whereby setting the same object twice to a scalar attribute could log it as an orphan [ticket:925] - generative select.order_by(None) / group_by(None) was not managing to reset order by/group by criterion, fixed [ticket:924]
Diffstat (limited to 'test/sql/select.py')
-rw-r--r--test/sql/select.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/sql/select.py b/test/sql/select.py
index a5d45a6b8..0df575c7c 100644
--- a/test/sql/select.py
+++ b/test/sql/select.py
@@ -487,6 +487,17 @@ sq.myothertable_othername AS sq_myothertable_othername FROM (" + sqstring + ") A
table2.select(order_by = [table2.c.otherid, table2.c.othername.desc()]),
"SELECT myothertable.otherid, myothertable.othername FROM myothertable ORDER BY myothertable.otherid, myothertable.othername DESC"
)
+
+ # generative order_by
+ self.assert_compile(
+ table2.select().order_by(table2.c.otherid).order_by(table2.c.othername.desc()),
+ "SELECT myothertable.otherid, myothertable.othername FROM myothertable ORDER BY myothertable.otherid, myothertable.othername DESC"
+ )
+
+ self.assert_compile(
+ table2.select().order_by(table2.c.otherid).order_by(table2.c.othername.desc()).order_by(None),
+ "SELECT myothertable.otherid, myothertable.othername FROM myothertable"
+ )
def testgroupby(self):
self.assert_compile(
@@ -494,6 +505,17 @@ sq.myothertable_othername AS sq_myothertable_othername FROM (" + sqstring + ") A
"SELECT myothertable.othername, count(myothertable.otherid) AS count_1 FROM myothertable GROUP BY myothertable.othername"
)
+ # generative group by
+ self.assert_compile(
+ select([table2.c.othername, func.count(table2.c.otherid)]).group_by(table2.c.othername),
+ "SELECT myothertable.othername, count(myothertable.otherid) AS count_1 FROM myothertable GROUP BY myothertable.othername"
+ )
+
+ self.assert_compile(
+ select([table2.c.othername, func.count(table2.c.otherid)]).group_by(table2.c.othername).group_by(None),
+ "SELECT myothertable.othername, count(myothertable.otherid) AS count_1 FROM myothertable"
+ )
+
def testgroupby_and_orderby(self):
self.assert_compile(