| 1185 | eq_(found2, wanted) |
| 1186 | |
| 1187 | def test_union_ordered(self, connection): |
| 1188 | t1, t2, t3 = self.tables("t1", "t2", "t3") |
| 1189 | |
| 1190 | s1, s2 = ( |
| 1191 | select(t1.c.col3.label("col3"), t1.c.col4.label("col4")).where( |
| 1192 | t1.c.col2.in_(["t1col2r1", "t1col2r2"]), |
| 1193 | ), |
| 1194 | select(t2.c.col3.label("col3"), t2.c.col4.label("col4")).where( |
| 1195 | t2.c.col2.in_(["t2col2r2", "t2col2r3"]), |
| 1196 | ), |
| 1197 | ) |
| 1198 | u = union(s1, s2).order_by("col3", "col4") |
| 1199 | |
| 1200 | wanted = [ |
| 1201 | ("aaa", "aaa"), |
| 1202 | ("bbb", "bbb"), |
| 1203 | ("bbb", "ccc"), |
| 1204 | ("ccc", "aaa"), |
| 1205 | ] |
| 1206 | eq_(connection.execute(u).fetchall(), wanted) |
| 1207 | |
| 1208 | @testing.requires.subqueries |
| 1209 | def test_union_ordered_alias(self, connection): |