MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / test_cycle_rowswitch

Method test_cycle_rowswitch

test/orm/test_unitofworkv2.py:1094–1110  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1092 )
1093
1094 def test_cycle_rowswitch(self):
1095 Node, nodes = self.classes.Node, self.tables.nodes
1096
1097 self.mapper_registry.map_imperatively(
1098 Node, nodes, properties={"children": relationship(Node)}
1099 )
1100 sess = fixture_session()
1101
1102 n2, n3 = Node(data="n2", children=[]), Node(data="n3", children=[])
1103 n1 = Node(data="n1", children=[n2])
1104
1105 sess.add(n1)
1106 sess.flush()
1107 sess.delete(n2)
1108 n3.id = n2.id
1109 n1.children.append(n3)
1110 sess.flush()
1111
1112 def test_bidirectional_mutations_one(self):
1113 Node, nodes = self.classes.Node, self.tables.nodes

Callers

nothing calls this directly

Calls 8

relationshipFunction · 0.90
fixture_sessionFunction · 0.90
map_imperativelyMethod · 0.80
NodeClass · 0.70
addMethod · 0.45
flushMethod · 0.45
deleteMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected