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

Method _option_test_fixture

test/orm/test_pickled.py:119–143  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

117 )
118
119 def _option_test_fixture(self):
120 users, addresses, dingalings = (
121 self.tables.users,
122 self.tables.addresses,
123 self.tables.dingalings,
124 )
125
126 self.mapper_registry.map_imperatively(
127 User,
128 users,
129 properties={"addresses": relationship(Address, backref="user")},
130 )
131 self.mapper_registry.map_imperatively(
132 Address,
133 addresses,
134 properties={"dingaling": relationship(Dingaling)},
135 )
136 self.mapper_registry.map_imperatively(Dingaling, dingalings)
137 sess = fixture_session()
138 u1 = User(name="ed")
139 u1.addresses.append(Address(email_address="ed@bar.com"))
140 sess.add(u1)
141 sess.flush()
142 sess.expunge_all()
143 return sess, User, Address, Dingaling
144
145 def test_transient(self):
146 users, addresses = (self.tables.users, self.tables.addresses)

Callers 2

test_unbound_optionsMethod · 0.95
test_bound_optionsMethod · 0.95

Calls 9

relationshipFunction · 0.90
fixture_sessionFunction · 0.90
UserClass · 0.90
AddressClass · 0.90
map_imperativelyMethod · 0.80
appendMethod · 0.45
addMethod · 0.45
flushMethod · 0.45
expunge_allMethod · 0.45

Tested by

no test coverage detected