| 1117 | eq_(found2, wanted) |
| 1118 | |
| 1119 | def test_union_ordered(self, connection): |
| 1120 | t1, t2, t3 = self.tables("t1", "t2", "t3") |
| 1121 | |
| 1122 | s1, s2 = ( |
| 1123 | select(t1.c.col3.label("col3"), t1.c.col4.label("col4")).where( |
| 1124 | t1.c.col2.in_(["t1col2r1", "t1col2r2"]), |
| 1125 | ), |
| 1126 | select(t2.c.col3.label("col3"), t2.c.col4.label("col4")).where( |
| 1127 | t2.c.col2.in_(["t2col2r2", "t2col2r3"]), |
| 1128 | ), |
| 1129 | ) |
| 1130 | u = union(s1, s2).order_by("col3", "col4") |
| 1131 | |
| 1132 | wanted = [ |
| 1133 | ("aaa", "aaa"), |
| 1134 | ("bbb", "bbb"), |
| 1135 | ("bbb", "ccc"), |
| 1136 | ("ccc", "aaa"), |
| 1137 | ] |
| 1138 | eq_(connection.execute(u).fetchall(), wanted) |
| 1139 | |
| 1140 | @testing.requires.subqueries |
| 1141 | def test_union_ordered_alias(self, connection): |