MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_identity_key_2

Method test_identity_key_2

test/orm/test_utils.py:618–627  ·  view source on GitHub ↗
(self, ormutil)

Source from the content-addressed store, hash-verified

616
617 @_cases()
618 def test_identity_key_2(self, ormutil):
619 users, User = self.tables.users, self.classes.User
620
621 self.mapper_registry.map_imperatively(User, users)
622 s = fixture_session()
623 u = User(name="u1")
624 s.add(u)
625 s.flush()
626 key = ormutil.identity_key(instance=u)
627 eq_(key, (User, (u.id,), None))
628
629 @_cases()
630 @testing.combinations("dict", "row", "mapping", argnames="rowtype")

Callers

nothing calls this directly

Calls 7

fixture_sessionFunction · 0.90
eq_Function · 0.90
map_imperativelyMethod · 0.80
UserClass · 0.70
addMethod · 0.45
flushMethod · 0.45
identity_keyMethod · 0.45

Tested by

no test coverage detected