MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_inplace_add

Method test_inplace_add

test/ext/test_baked.py:54–72  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

52 eq_(q1.steps, [l1])
53
54 def test_inplace_add(self):
55 User = self.classes.User
56 session = fixture_session()
57
58 def l1():
59 return session.query(User)
60
61 def l2(q):
62 return q.filter(User.name == bindparam("name"))
63
64 q1 = self.bakery(l1)
65 self._assert_cache_key(q1._cache_key, [l1])
66 eq_(q1.steps, [l1])
67
68 q2 = q1.add_criteria(l2)
69 is_(q2, q1)
70
71 self._assert_cache_key(q1._cache_key, [l1, l2])
72 eq_(q1.steps, [l1, l2])
73
74 def test_inplace_add_operator(self):
75 User = self.classes.User

Callers

nothing calls this directly

Calls 6

_assert_cache_keyMethod · 0.95
fixture_sessionFunction · 0.90
eq_Function · 0.90
is_Function · 0.90
bakeryMethod · 0.80
add_criteriaMethod · 0.45

Tested by

no test coverage detected