MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_none

Method test_none

test/orm/inheritance/test_basic.py:1671–1693  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1669 )
1670
1671 def test_none(self):
1672 A, B, C = self.classes("A", "B", "C")
1673 self._fixture()
1674
1675 s = fixture_session()
1676 a1, b1, c1 = A(id=1), B(id=2), C(cid=1, id=3)
1677 s.add_all([a1, b1, c1])
1678 s.commit()
1679
1680 # want to see if the 'C' table loads even though
1681 # a and b are loaded
1682 c1 = s.query(B).filter_by(id=3).first()
1683 s.delete(c1)
1684 with self.sql_execution_asserter(testing.db) as asserter:
1685 s.flush()
1686 asserter.assert_(
1687 RegexSQL(
1688 "SELECT .* FROM c WHERE :param_1 = c.bid", [{"param_1": 3}]
1689 ),
1690 CompiledSQL("DELETE FROM c WHERE c.cid = :cid", [{"cid": 1}]),
1691 CompiledSQL("DELETE FROM b WHERE b.id = :id", [{"id": 3}]),
1692 CompiledSQL("DELETE FROM a WHERE a.id = :id", [{"id": 3}]),
1693 )
1694
1695 def test_c_only(self):
1696 A, B, C = self.classes("A", "B", "C")

Callers

nothing calls this directly

Calls 15

_fixtureMethod · 0.95
fixture_sessionFunction · 0.90
RegexSQLClass · 0.90
CompiledSQLClass · 0.90
AClass · 0.70
BClass · 0.70
CClass · 0.70
add_allMethod · 0.45
commitMethod · 0.45
firstMethod · 0.45
filter_byMethod · 0.45

Tested by

no test coverage detected