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

Method test_flush

test/orm/test_cycles.py:399–432  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

397 pass
398
399 def test_flush(self):
400 a, A, c, b, C, B = (
401 self.tables.a,
402 self.classes.A,
403 self.tables.c,
404 self.tables.b,
405 self.classes.C,
406 self.classes.B,
407 )
408
409 self.mapper_registry.map_imperatively(
410 A,
411 a,
412 properties={"cs": relationship(C, primaryjoin=a.c.cid == c.c.id)},
413 )
414
415 self.mapper_registry.map_imperatively(
416 B, b, inherits=A, inherit_condition=b.c.id == a.c.id
417 )
418
419 self.mapper_registry.map_imperatively(
420 C,
421 c,
422 properties={
423 "arel": relationship(A, primaryjoin=a.c.id == c.c.aid)
424 },
425 )
426
427 sess = fixture_session()
428 bobj = B()
429 sess.add(bobj)
430 cobj = C()
431 sess.add(cobj)
432 sess.flush()
433
434
435class BiDirectionalManyToOneTest(fixtures.MappedTest):

Callers

nothing calls this directly

Calls 7

relationshipFunction · 0.90
fixture_sessionFunction · 0.90
map_imperativelyMethod · 0.80
BClass · 0.70
CClass · 0.70
addMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected