MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_reconstructor_init

Method test_reconstructor_init

test/orm/test_mapper.py:2393–2410  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2391 eq_(recon, ["A", "B", "C"])
2392
2393 def test_reconstructor_init(self):
2394 users = self.tables.users
2395
2396 recon = []
2397
2398 class User:
2399 @reconstructor
2400 def __init__(self):
2401 recon.append("go")
2402
2403 self.mapper(User, users)
2404
2405 User()
2406 eq_(recon, ["go"])
2407
2408 recon[:] = []
2409 fixture_session().query(User).first()
2410 eq_(recon, ["go"])
2411
2412 def test_reconstructor_init_callable_object(self):
2413 """test #6538"""

Callers

nothing calls this directly

Calls 6

eq_Function · 0.90
fixture_sessionFunction · 0.90
UserClass · 0.70
mapperMethod · 0.45
firstMethod · 0.45
queryMethod · 0.45

Tested by

no test coverage detected