MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_comparator

Method test_comparator

test/orm/test_composites.py:208–229  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

206 self.assert_sql_count(testing.db, go, 1)
207
208 def test_comparator(self):
209 Graph, Edge, Point = (
210 self.classes.Graph,
211 self.classes.Edge,
212 self.classes.Point,
213 )
214
215 sess = self._fixture()
216
217 g = sess.query(Graph).first()
218
219 assert (
220 sess.query(Edge).filter(Edge.start == Point(3, 4)).one()
221 is g.edges[0]
222 )
223
224 assert (
225 sess.query(Edge).filter(Edge.start != Point(3, 4)).first()
226 is g.edges[1]
227 )
228
229 eq_(sess.query(Edge).filter(Edge.start == None).all(), []) # noqa
230
231 def test_comparator_aliased(self):
232 Graph, Edge, Point = (

Callers

nothing calls this directly

Calls 8

_fixtureMethod · 0.95
eq_Function · 0.90
PointClass · 0.70
firstMethod · 0.45
queryMethod · 0.45
oneMethod · 0.45
filterMethod · 0.45
allMethod · 0.45

Tested by

no test coverage detected