MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_intersect

Method test_intersect

test/orm/test_query.py:4075–4085  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4073
4074 @testing.requires.intersect
4075 def test_intersect(self):
4076 User = self.classes.User
4077
4078 s = fixture_session()
4079
4080 fred = s.query(User).filter(User.name == "fred")
4081 ed = s.query(User).filter(User.name == "ed")
4082 jack = s.query(User).filter(User.name == "jack")
4083 eq_(fred.intersect(ed, jack).all(), [])
4084
4085 eq_(fred.union(ed).intersect(ed.union(jack)).all(), [User(name="ed")])
4086
4087 def test_eager_load(self):
4088 User, Address = self.classes.User, self.classes.Address

Callers

nothing calls this directly

Calls 8

fixture_sessionFunction · 0.90
eq_Function · 0.90
UserClass · 0.70
filterMethod · 0.45
queryMethod · 0.45
allMethod · 0.45
intersectMethod · 0.45
unionMethod · 0.45

Tested by

no test coverage detected