(self)
| 1924 | assert edge_1 in near_edges and edge_2 in near_edges |
| 1925 | |
| 1926 | def test_order_by(self): |
| 1927 | self._fixture(False) |
| 1928 | Edge = self.classes.Edge |
| 1929 | s = fixture_session() |
| 1930 | self.assert_compile( |
| 1931 | s.query(Edge).order_by(Edge.start, Edge.end.desc()), |
| 1932 | "SELECT edge.id AS edge_id, edge.x1 AS edge_x1, " |
| 1933 | "edge.y1 AS edge_y1, edge.x2 AS edge_x2, edge.y2 AS edge_y2 " |
| 1934 | "FROM edge ORDER BY edge.x1, edge.y1, edge.x2 DESC, edge.y2 DESC", |
| 1935 | ) |
| 1936 | |
| 1937 | self.assert_compile( |
| 1938 | s.query(Edge).order_by( |
| 1939 | Edge.start.asc().nulls_first(), Edge.end.nulls_last() |
| 1940 | ), |
| 1941 | "SELECT edge.id AS edge_id, edge.x1 AS edge_x1, " |
| 1942 | "edge.y1 AS edge_y1, edge.x2 AS edge_x2, edge.y2 AS edge_y2 " |
| 1943 | "FROM edge ORDER BY edge.x1 ASC NULLS FIRST, " |
| 1944 | "edge.y1 ASC NULLS FIRST, edge.x2 NULLS LAST, edge.y2 NULLS LAST", |
| 1945 | ) |
| 1946 | |
| 1947 | # Test using standalone ops syntax |
| 1948 | |
| 1949 | self.assert_compile( |
| 1950 | s.query(Edge).order_by( |
| 1951 | nulls_first(asc(Edge.start)), nulls_last(Edge.end) |
| 1952 | ), |
| 1953 | "SELECT edge.id AS edge_id, edge.x1 AS edge_x1, " |
| 1954 | "edge.y1 AS edge_y1, edge.x2 AS edge_x2, edge.y2 AS edge_y2 " |
| 1955 | "FROM edge ORDER BY edge.x1 ASC NULLS FIRST, " |
| 1956 | "edge.y1 ASC NULLS FIRST, edge.x2 NULLS LAST, edge.y2 NULLS LAST", |
| 1957 | ) |
| 1958 | |
| 1959 | def test_order_by_custom(self): |
| 1960 | """test #12769""" |
nothing calls this directly
no test coverage detected