MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _option_test_fixture

Method _option_test_fixture

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

Source from the content-addressed store, hash-verified

102 )
103
104 def _option_test_fixture(self):
105 users, addresses, dingalings = (
106 self.tables.users,
107 self.tables.addresses,
108 self.tables.dingalings,
109 )
110
111 self.mapper_registry.map_imperatively(
112 User,
113 users,
114 properties={"addresses": relationship(Address, backref="user")},
115 )
116 self.mapper_registry.map_imperatively(
117 Address,
118 addresses,
119 properties={"dingaling": relationship(Dingaling)},
120 )
121 self.mapper_registry.map_imperatively(Dingaling, dingalings)
122 sess = fixture_session()
123 u1 = User(name="ed")
124 u1.addresses.append(Address(email_address="ed@bar.com"))
125 sess.add(u1)
126 sess.flush()
127 sess.expunge_all()
128 return sess, User, Address, Dingaling
129
130 def test_transient(self):
131 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